diff options
Diffstat (limited to 'server/middlewares/validators/search.ts')
-rw-r--r-- | server/middlewares/validators/search.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts index 7bbf81048..6bb335127 100644 --- a/server/middlewares/validators/search.ts +++ b/server/middlewares/validators/search.ts | |||
@@ -1,6 +1,7 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import { query } from 'express-validator' | 2 | import { query } from 'express-validator' |
3 | import { isSearchTargetValid } from '@server/helpers/custom-validators/search' | 3 | import { isSearchTargetValid } from '@server/helpers/custom-validators/search' |
4 | import { isHostValid } from '@server/helpers/custom-validators/servers' | ||
4 | import { isDateValid } from '../../helpers/custom-validators/misc' | 5 | import { isDateValid } from '../../helpers/custom-validators/misc' |
5 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
6 | import { areValidationErrors } from './shared' | 7 | import { areValidationErrors } from './shared' |
@@ -8,6 +9,10 @@ import { areValidationErrors } from './shared' | |||
8 | const videosSearchValidator = [ | 9 | const videosSearchValidator = [ |
9 | query('search').optional().not().isEmpty().withMessage('Should have a valid search'), | 10 | query('search').optional().not().isEmpty().withMessage('Should have a valid search'), |
10 | 11 | ||
12 | query('host') | ||
13 | .optional() | ||
14 | .custom(isHostValid).withMessage('Should have a valid host'), | ||
15 | |||
11 | query('startDate') | 16 | query('startDate') |
12 | .optional() | 17 | .optional() |
13 | .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'), | 18 | .custom(isDateValid).withMessage('Should have a start date that conforms to ISO 8601'), |