1 import 'express-validator'
2 import * as express from 'express'
4 import { checkErrors } from './utils'
5 import { logger } from '../../helpers'
7 function paginationValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
8 req.checkQuery('start', 'Should have a number start').optional().isInt()
9 req.checkQuery('count', 'Should have a number count').optional().isInt()
11 logger.debug('Checking pagination parameters', { parameters: req.query })
13 checkErrors(req, res, next)
16 // ---------------------------------------------------------------------------