diff options
Diffstat (limited to 'server/middlewares/validators/pagination.ts')
-rw-r--r-- | server/middlewares/validators/pagination.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/validators/pagination.ts b/server/middlewares/validators/pagination.ts index 0895b4eb8..25debfa6e 100644 --- a/server/middlewares/validators/pagination.ts +++ b/server/middlewares/validators/pagination.ts | |||
@@ -4,8 +4,8 @@ import { logger } from '../../helpers' | |||
4 | import { areValidationErrors } from './utils' | 4 | import { areValidationErrors } from './utils' |
5 | 5 | ||
6 | const paginationValidator = [ | 6 | const paginationValidator = [ |
7 | query('start').optional().isInt().withMessage('Should have a number start'), | 7 | query('start').optional().isInt({ min: 0 }).withMessage('Should have a number start'), |
8 | query('count').optional().isInt().withMessage('Should have a number count'), | 8 | query('count').optional().isInt({ min: 0 }).withMessage('Should have a number count'), |
9 | 9 | ||
10 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 10 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
11 | logger.debug('Checking pagination parameters', { parameters: req.query }) | 11 | logger.debug('Checking pagination parameters', { parameters: req.query }) |