aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/search.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-20 18:31:49 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:04:05 +0200
commit0b18f4aa80df8868bf34605423c7a298dffbb2aa (patch)
tree25299da5d94fc73e88b21e87aeb2c156999c6fcd /server/middlewares/validators/search.ts
parentd525fc399a14a8b16eaad6d4c0bc0a9c4093c3c9 (diff)
downloadPeerTube-0b18f4aa80df8868bf34605423c7a298dffbb2aa.tar.gz
PeerTube-0b18f4aa80df8868bf34605423c7a298dffbb2aa.tar.zst
PeerTube-0b18f4aa80df8868bf34605423c7a298dffbb2aa.zip
Add advanced search in client
Diffstat (limited to 'server/middlewares/validators/search.ts')
-rw-r--r--server/middlewares/validators/search.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts
index fb2148eb3..a97f5b581 100644
--- a/server/middlewares/validators/search.ts
+++ b/server/middlewares/validators/search.ts
@@ -2,7 +2,7 @@ import * as express from 'express'
2import { areValidationErrors } from './utils' 2import { areValidationErrors } from './utils'
3import { logger } from '../../helpers/logger' 3import { logger } from '../../helpers/logger'
4import { query } from 'express-validator/check' 4import { query } from 'express-validator/check'
5import { isNumberArray, isStringArray } from '../../helpers/custom-validators/search' 5import { isNumberArray, isStringArray, isNSFWQueryValid } from '../../helpers/custom-validators/search'
6import { isBooleanValid, isDateValid, toArray } from '../../helpers/custom-validators/misc' 6import { isBooleanValid, isDateValid, toArray } from '../../helpers/custom-validators/misc'
7 7
8const searchValidator = [ 8const searchValidator = [
@@ -46,8 +46,7 @@ const commonVideosFiltersValidator = [
46 .custom(isStringArray).withMessage('Should have a valid all of tags array'), 46 .custom(isStringArray).withMessage('Should have a valid all of tags array'),
47 query('nsfw') 47 query('nsfw')
48 .optional() 48 .optional()
49 .toBoolean() 49 .custom(isNSFWQueryValid).withMessage('Should have a valid NSFW attribute'),
50 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'),
51 50
52 (req: express.Request, res: express.Response, next: express.NextFunction) => { 51 (req: express.Request, res: express.Response, next: express.NextFunction) => {
53 logger.debug('Checking commons video filters query', { parameters: req.query }) 52 logger.debug('Checking commons video filters query', { parameters: req.query })