aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-19 16:17:54 +0200
committerChocobozzz <me@florianbigard.com>2018-07-24 14:04:05 +0200
commit57c36b277e68b764dd34cb2e449f6e2ca3d1e9b6 (patch)
tree87ebcd623c06445b9b25a237addefc98a2d64afa /server/middlewares/validators/videos.ts
parent7279b455811f4806dcb74a08d17b837bc22533c1 (diff)
downloadPeerTube-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.ts15
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import 'express-validator' 2import 'express-validator'
3import { body, param, query, ValidationChain } from 'express-validator/check' 3import { body, param, ValidationChain } from 'express-validator/check'
4import { UserRight, VideoPrivacy } from '../../../shared' 4import { UserRight, VideoPrivacy } from '../../../shared'
5import { 5import {
6 isBooleanValid, 6 isBooleanValid,
@@ -172,18 +172,6 @@ const videosRemoveValidator = [
172 } 172 }
173] 173]
174 174
175const 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
187const videoAbuseReportValidator = [ 175const 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,