X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-stats.ts;h=ddbf2a564545fc9ff5d67778869cd6e3a5bd5076;hb=396f6f0140b0f76162e2378fd5a61e2f888673ed;hp=f17fbcc0953a2fe83c5628909d765138a7e20105;hpb=49f0468d44468528c2fb2c8b0efd19cdaeeec43d;p=github%2FChocobozzz%2FPeerTube.git 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 = [ query('startDate') .optional() - .custom(isDateValid) - .withMessage('Should have a valid start date'), + .custom(isDateValid), query('endDate') .optional() - .custom(isDateValid) - .withMessage('Should have a valid end date'), + .custom(isDateValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoOverallStatsValidator parameters', { parameters: req.body }) @@ -54,18 +52,15 @@ const videoTimeserieStatsValidator = [ isValidVideoIdParam('videoId'), param('metric') - .custom(isValidStatTimeserieMetric) - .withMessage('Should have a valid timeserie metric'), + .custom(isValidStatTimeserieMetric), query('startDate') .optional() - .custom(isDateValid) - .withMessage('Should have a valid start date'), + .custom(isDateValid), query('endDate') .optional() - .custom(isDateValid) - .withMessage('Should have a valid end date'), + .custom(isDateValid), async (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking videoTimeserieStatsValidator parameters', { parameters: req.body })