1
0
Fork 0
peertube/server/middlewares/reqValidators/pagination.js
2016-05-17 21:03:00 +02:00

21 lines
596 B
JavaScript

'use strict'
const checkErrors = require('./utils').checkErrors
const logger = require('../../helpers/logger')
const reqValidatorsPagination = {
pagination: pagination
}
function pagination (req, res, next) {
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.query })
checkErrors(req, res, next)
}
// ---------------------------------------------------------------------------
module.exports = reqValidatorsPagination