aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-08 14:15:16 +0100
committerChocobozzz <me@florianbigard.com>2020-01-08 14:15:16 +0100
commitfe98765624cdd6695739bda719fcb726b71c2b2a (patch)
tree18b19d427e5c25fc9e5290062f307e668f4c9e45 /server/middlewares/validators/videos
parentddc07312b041c1c533b68a919681fc9bce83430d (diff)
downloadPeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.tar.gz
PeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.tar.zst
PeerTube-fe98765624cdd6695739bda719fcb726b71c2b2a.zip
Add ability to skip count query
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r--server/middlewares/validators/videos/videos.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 5e0182cc3..6733d9dec 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -381,6 +381,10 @@ const commonVideosFiltersValidator = [
381 query('filter') 381 query('filter')
382 .optional() 382 .optional()
383 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'), 383 .custom(isVideoFilterValid).withMessage('Should have a valid filter attribute'),
384 query('skipCount')
385 .optional()
386 .customSanitizer(toBooleanOrNull)
387 .custom(isBooleanValid).withMessage('Should have a valid skip count boolean'),
384 388
385 (req: express.Request, res: express.Response, next: express.NextFunction) => { 389 (req: express.Request, res: express.Response, next: express.NextFunction) => {
386 logger.debug('Checking commons video filters query', { parameters: req.query }) 390 logger.debug('Checking commons video filters query', { parameters: req.query })