]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-stats.ts
store uploaded video filename (#4885)
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-stats.ts
index 12509abdecc8cbf6db80014c94b9ce2a5ca9dfee..f17fbcc0953a2fe83c5628909d765138a7e20105 100644 (file)
@@ -10,6 +10,16 @@ import { areValidationErrors, checkUserCanManageVideo, doesVideoExist, isValidVi
 const videoOverallStatsValidator = [
   isValidVideoIdParam('videoId'),
 
+  query('startDate')
+    .optional()
+    .custom(isDateValid)
+    .withMessage('Should have a valid start date'),
+
+  query('endDate')
+    .optional()
+    .custom(isDateValid)
+    .withMessage('Should have a valid end date'),
+
   async (req: express.Request, res: express.Response, next: express.NextFunction) => {
     logger.debug('Checking videoOverallStatsValidator parameters', { parameters: req.body })