aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/search.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/search.ts')
-rw-r--r--server/middlewares/validators/search.ts5
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import { query } from 'express-validator' 2import { query } from 'express-validator'
3import { isSearchTargetValid } from '@server/helpers/custom-validators/search' 3import { isSearchTargetValid } from '@server/helpers/custom-validators/search'
4import { isHostValid } from '@server/helpers/custom-validators/servers'
4import { isDateValid } from '../../helpers/custom-validators/misc' 5import { isDateValid } from '../../helpers/custom-validators/misc'
5import { logger } from '../../helpers/logger' 6import { logger } from '../../helpers/logger'
6import { areValidationErrors } from './shared' 7import { areValidationErrors } from './shared'
@@ -8,6 +9,10 @@ import { areValidationErrors } from './shared'
8const videosSearchValidator = [ 9const 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'),