From 0b18f4aa80df8868bf34605423c7a298dffbb2aa Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 20 Jul 2018 18:31:49 +0200 Subject: Add advanced search in client --- server/middlewares/validators/search.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server/middlewares/validators/search.ts') 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' import { areValidationErrors } from './utils' import { logger } from '../../helpers/logger' import { query } from 'express-validator/check' -import { isNumberArray, isStringArray } from '../../helpers/custom-validators/search' +import { isNumberArray, isStringArray, isNSFWQueryValid } from '../../helpers/custom-validators/search' import { isBooleanValid, isDateValid, toArray } from '../../helpers/custom-validators/misc' const searchValidator = [ @@ -46,8 +46,7 @@ const commonVideosFiltersValidator = [ .custom(isStringArray).withMessage('Should have a valid all of tags array'), query('nsfw') .optional() - .toBoolean() - .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), + .custom(isNSFWQueryValid).withMessage('Should have a valid NSFW attribute'), (req: express.Request, res: express.Response, next: express.NextFunction) => { logger.debug('Checking commons video filters query', { parameters: req.query }) -- cgit v1.2.3