diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-stats.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-stats.ts | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/server/middlewares/validators/videos/video-stats.ts b/server/middlewares/validators/videos/video-stats.ts index f17fbcc09..ddbf2a564 100644 --- a/server/middlewares/validators/videos/video-stats.ts +++ b/server/middlewares/validators/videos/video-stats.ts | |||
@@ -12,13 +12,11 @@ const videoOverallStatsValidator = [ | |||
12 | 12 | ||
13 | query('startDate') | 13 | query('startDate') |
14 | .optional() | 14 | .optional() |
15 | .custom(isDateValid) | 15 | .custom(isDateValid), |
16 | .withMessage('Should have a valid start date'), | ||
17 | 16 | ||
18 | query('endDate') | 17 | query('endDate') |
19 | .optional() | 18 | .optional() |
20 | .custom(isDateValid) | 19 | .custom(isDateValid), |
21 | .withMessage('Should have a valid end date'), | ||
22 | 20 | ||
23 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 21 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
24 | logger.debug('Checking videoOverallStatsValidator parameters', { parameters: req.body }) | 22 | logger.debug('Checking videoOverallStatsValidator parameters', { parameters: req.body }) |
@@ -54,18 +52,15 @@ const videoTimeserieStatsValidator = [ | |||
54 | isValidVideoIdParam('videoId'), | 52 | isValidVideoIdParam('videoId'), |
55 | 53 | ||
56 | param('metric') | 54 | param('metric') |
57 | .custom(isValidStatTimeserieMetric) | 55 | .custom(isValidStatTimeserieMetric), |
58 | .withMessage('Should have a valid timeserie metric'), | ||
59 | 56 | ||
60 | query('startDate') | 57 | query('startDate') |
61 | .optional() | 58 | .optional() |
62 | .custom(isDateValid) | 59 | .custom(isDateValid), |
63 | .withMessage('Should have a valid start date'), | ||
64 | 60 | ||
65 | query('endDate') | 61 | query('endDate') |
66 | .optional() | 62 | .optional() |
67 | .custom(isDateValid) | 63 | .custom(isDateValid), |
68 | .withMessage('Should have a valid end date'), | ||
69 | 64 | ||
70 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { | 65 | async (req: express.Request, res: express.Response, next: express.NextFunction) => { |
71 | logger.debug('Checking videoTimeserieStatsValidator parameters', { parameters: req.body }) | 66 | logger.debug('Checking videoTimeserieStatsValidator parameters', { parameters: req.body }) |