]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/search.ts
Add video caption upload documentation and improve error message
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / search.ts
index 6a95d60958feb4e2a9bd9d05ef2885a4f2c647a2..5a3c83f2ca9bbe18033426fbca9c4c618907cafc 100644 (file)
@@ -1,7 +1,7 @@
 import * as express from 'express'
 import { areValidationErrors } from './utils'
 import { logger } from '../../helpers/logger'
-import { query } from 'express-validator/check'
+import { query } from 'express-validator'
 import { isDateValid } from '../../helpers/custom-validators/misc'
 
 const videosSearchValidator = [
@@ -10,6 +10,9 @@ const videosSearchValidator = [
   query('startDate').optional().custom(isDateValid).withMessage('Should have a valid start date'),
   query('endDate').optional().custom(isDateValid).withMessage('Should have a valid end date'),
 
+  query('originallyPublishedStartDate').optional().custom(isDateValid).withMessage('Should have a valid published start date'),
+  query('originallyPublishedEndDate').optional().custom(isDateValid).withMessage('Should have a valid published end date'),
+
   query('durationMin').optional().isInt().withMessage('Should have a valid min duration'),
   query('durationMax').optional().isInt().withMessage('Should have a valid max duration'),