1
0
Fork 0
peertube/server/middlewares/reqValidators/pagination.js

22 lines
596 B
JavaScript
Raw Normal View History

'use strict'
const checkErrors = require('./utils').checkErrors
const logger = require('../../helpers/logger')
const reqValidatorsPagination = {
pagination: pagination
}
function pagination (req, res, next) {
2016-05-17 15:03:00 -04:00
req.checkQuery('start', 'Should have a number start').optional().isInt()
req.checkQuery('count', 'Should have a number count').optional().isInt()
2016-05-17 15:03:00 -04:00
logger.debug('Checking pagination parameters', { parameters: req.query })
checkErrors(req, res, next)
}
// ---------------------------------------------------------------------------
module.exports = reqValidatorsPagination