aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/search.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-07-29 10:27:24 +0200
committerChocobozzz <me@florianbigard.com>2021-07-29 10:27:24 +0200
commitb033851fb54241bb703f86add025229e68cc6f59 (patch)
treed60dac1499a95bf9dc902dee24f325fe0f8b6acb /server/middlewares/validators/search.ts
parentfbd67e7f386504e50f2504cb6386700a58906f16 (diff)
downloadPeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.gz
PeerTube-b033851fb54241bb703f86add025229e68cc6f59.tar.zst
PeerTube-b033851fb54241bb703f86add025229e68cc6f59.zip
Search channels against handles and not names
Diffstat (limited to 'server/middlewares/validators/search.ts')
-rw-r--r--server/middlewares/validators/search.ts7
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'
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 { isHostValid } from '@server/helpers/custom-validators/servers'
5import { areUUIDsValid, isDateValid, toCompleteUUIDs } from '../../helpers/custom-validators/misc' 5import { areUUIDsValid, isDateValid, isNotEmptyStringArray, toCompleteUUIDs } from '../../helpers/custom-validators/misc'
6import { logger } from '../../helpers/logger' 6import { logger } from '../../helpers/logger'
7import { areValidationErrors } from './shared' 7import { 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 })