diff options
author | Chocobozzz <me@florianbigard.com> | 2018-07-19 16:17:54 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-07-24 14:04:05 +0200 |
commit | 57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6 (patch) | |
tree | 87ebcd623c06445b9b25a237addefc98a2d64afa /server/middlewares/validators/videos.ts | |
parent | 7279b455811f4806dcb74a08d17b837bc22533c1 (diff) | |
download | PeerTube-57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6.tar.gz PeerTube-57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6.tar.zst PeerTube-57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6.zip |
Begin advanced search
Diffstat (limited to 'server/middlewares/validators/videos.ts')
-rw-r--r-- | server/middlewares/validators/videos.ts | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts index abb23b510..d9af2aa0a 100644 --- a/server/middlewares/validators/videos.ts +++ b/server/middlewares/validators/videos.ts | |||
@@ -1,6 +1,6 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import 'express-validator' | 2 | import 'express-validator' |
3 | import { body, param, query, ValidationChain } from 'express-validator/check' | 3 | import { body, param, ValidationChain } from 'express-validator/check' |
4 | import { UserRight, VideoPrivacy } from '../../../shared' | 4 | import { UserRight, VideoPrivacy } from '../../../shared' |
5 | import { | 5 | import { |
6 | isBooleanValid, | 6 | isBooleanValid, |
@@ -172,18 +172,6 @@ const videosRemoveValidator = [ | |||
172 | } | 172 | } |
173 | ] | 173 | ] |
174 | 174 | ||
175 | const videosSearchValidator = [ | ||
176 | query('search').not().isEmpty().withMessage('Should have a valid search'), | ||
177 | |||
178 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | ||
179 | logger.debug('Checking videosSearch parameters', { parameters: req.params }) | ||
180 | |||
181 | if (areValidationErrors(req, res)) return | ||
182 | |||
183 | return next() | ||
184 | } | ||
185 | ] | ||
186 | |||
187 | const videoAbuseReportValidator = [ | 175 | const videoAbuseReportValidator = [ |
188 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), | 176 | param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), |
189 | body('reason').custom(isVideoAbuseReasonValid).withMessage('Should have a valid reason'), | 177 | body('reason').custom(isVideoAbuseReasonValid).withMessage('Should have a valid reason'), |
@@ -240,7 +228,6 @@ export { | |||
240 | videosUpdateValidator, | 228 | videosUpdateValidator, |
241 | videosGetValidator, | 229 | videosGetValidator, |
242 | videosRemoveValidator, | 230 | videosRemoveValidator, |
243 | videosSearchValidator, | ||
244 | videosShareValidator, | 231 | videosShareValidator, |
245 | 232 | ||
246 | videoAbuseReportValidator, | 233 | videoAbuseReportValidator, |