]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/reqValidators/pagination.js
Add ability to sort videos list
[github/Chocobozzz/PeerTube.git] / server / middlewares / reqValidators / pagination.js
index ca8375396f4f1c4aa43a9d90d9b7befa85f42214..e598f269a8abf34401257fcc343c905d3754541e 100644 (file)
@@ -8,10 +8,10 @@ const reqValidatorsPagination = {
 }
 
 function pagination (req, res, next) {
-  req.checkParams('start', 'Should have a number start').optional().isInt()
-  req.checkParams('count', 'Should have a number count').optional().isInt()
+  req.checkQuery('start', 'Should have a number start').optional().isInt()
+  req.checkQuery('count', 'Should have a number count').optional().isInt()
 
-  logger.debug('Checking pagination parameters', { parameters: req.params })
+  logger.debug('Checking pagination parameters', { parameters: req.query })
 
   checkErrors(req, res, next)
 }