This commit is contained in:
Chocobozzz 2021-08-02 16:17:44 +02:00
parent a5095a2ca8
commit 101780a643
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -6,11 +6,11 @@ import { areValidationErrors } from './utils'
const paginationValidator = [
check('start')
.optional()
.isInt({ min: 0, max: PAGINATION_START.MAX }).withMessage(`Should have a number start (>= 0 and < ${PAGINATION_START.MAX}`),
.isInt({ min: 0, max: PAGINATION_START.MAX }).withMessage(`Should have a number start (>= 0 and < ${PAGINATION_START.MAX})`),
check('count')
.optional()
.isInt({ min: 0, max: PAGINATION_COUNT.MAX }).withMessage(`Should have a number count (> 0 and < ${PAGINATION_COUNT.MAX}`),
.isInt({ min: 0, max: PAGINATION_COUNT.MAX }).withMessage(`Should have a number count (> 0 and < ${PAGINATION_COUNT.MAX})`),
(req: express.Request, res: express.Response, next: express.NextFunction) => {
if (areValidationErrors(req, res)) return