diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:27:04 +0200 |
commit | 396f6f0140b0f76162e2378fd5a61e2f888673ed (patch) | |
tree | a5bd668bfc7dca7f311b9fc42ebb8bd01f462648 /server/middlewares/validators/metrics.ts | |
parent | 97eba003a9d0adcb0cab9190f566327b1417c7d3 (diff) | |
download | PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.gz PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.tar.zst PeerTube-396f6f0140b0f76162e2378fd5a61e2f888673ed.zip |
Cleanup useless express validator messages
Diffstat (limited to 'server/middlewares/validators/metrics.ts')
-rw-r--r-- | server/middlewares/validators/metrics.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/server/middlewares/validators/metrics.ts b/server/middlewares/validators/metrics.ts index b1dbec603..cd6f872da 100644 --- a/server/middlewares/validators/metrics.ts +++ b/server/middlewares/validators/metrics.ts | |||
@@ -9,30 +9,29 @@ import { areValidationErrors, doesVideoExist } from './shared' | |||
9 | 9 | ||
10 | const addPlaybackMetricValidator = [ | 10 | const addPlaybackMetricValidator = [ |
11 | body('resolution') | 11 | body('resolution') |
12 | .isInt({ min: 0 }).withMessage('Invalid resolution'), | 12 | .isInt({ min: 0 }), |
13 | body('fps') | 13 | body('fps') |
14 | .optional() | 14 | .optional() |
15 | .isInt({ min: 0 }).withMessage('Invalid fps'), | 15 | .isInt({ min: 0 }), |
16 | body('playerMode') | 16 | body('playerMode') |
17 | .custom(isValidPlayerMode).withMessage('Invalid playerMode'), | 17 | .custom(isValidPlayerMode), |
18 | 18 | ||
19 | body('resolutionChanges') | 19 | body('resolutionChanges') |
20 | .isInt({ min: 0 }).withMessage('Invalid resolutionChanges'), | 20 | .isInt({ min: 0 }), |
21 | 21 | ||
22 | body('errors') | 22 | body('errors') |
23 | .isInt({ min: 0 }).withMessage('Invalid errors'), | 23 | .isInt({ min: 0 }), |
24 | 24 | ||
25 | body('downloadedBytesP2P') | 25 | body('downloadedBytesP2P') |
26 | .isInt({ min: 0 }).withMessage('Invalid downloadedBytesP2P'), | 26 | .isInt({ min: 0 }), |
27 | body('downloadedBytesHTTP') | 27 | body('downloadedBytesHTTP') |
28 | .isInt({ min: 0 }).withMessage('Invalid downloadedBytesHTTP'), | 28 | .isInt({ min: 0 }), |
29 | 29 | ||
30 | body('uploadedBytesP2P') | 30 | body('uploadedBytesP2P') |
31 | .isInt({ min: 0 }).withMessage('Invalid uploadedBytesP2P'), | 31 | .isInt({ min: 0 }), |
32 | 32 | ||
33 | body('videoId') | 33 | body('videoId') |
34 | .customSanitizer(toCompleteUUID) | 34 | .customSanitizer(toCompleteUUID) |
35 | .optional() | ||
36 | .custom(isIdOrUUIDValid), | 35 | .custom(isIdOrUUIDValid), |
37 | 36 | ||
38 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 37 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |