diff options
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/search.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts index cde300968..27d0e541d 100644 --- a/server/middlewares/validators/search.ts +++ b/server/middlewares/validators/search.ts | |||
@@ -2,7 +2,7 @@ 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 { isHostValid } from '@server/helpers/custom-validators/servers' |
5 | import { areUUIDsValid, isDateValid, toCompleteUUIDs } from '../../helpers/custom-validators/misc' | 5 | import { areUUIDsValid, isDateValid, isNotEmptyStringArray, toCompleteUUIDs } from '../../helpers/custom-validators/misc' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
7 | import { areValidationErrors } from './shared' | 7 | import { areValidationErrors } from './shared' |
8 | 8 | ||
@@ -64,9 +64,10 @@ const videoChannelsListSearchValidator = [ | |||
64 | .optional() | 64 | .optional() |
65 | .custom(isSearchTargetValid).withMessage('Should have a valid search target'), | 65 | .custom(isSearchTargetValid).withMessage('Should have a valid search target'), |
66 | 66 | ||
67 | query('names') | 67 | query('handles') |
68 | .optional() | 68 | .optional() |
69 | .toArray(), | 69 | .toArray() |
70 | .custom(isNotEmptyStringArray).withMessage('Should have valid handles'), | ||
70 | 71 | ||
71 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 72 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
72 | logger.debug('Checking video channels search query', { parameters: req.query }) | 73 | logger.debug('Checking video channels search query', { parameters: req.query }) |