diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:58:40 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-17 14:58:40 +0200 |
commit | a85d530384761a0af833caac9b38b9834517c9fa (patch) | |
tree | 5407dbcc32b6324067632d4c99f25a6b7d851230 /server/middlewares/validators/pagination.ts | |
parent | 2ec349aa857b0bd8f26de5cd78981d60c9b98a69 (diff) | |
download | PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.gz PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.tar.zst PeerTube-a85d530384761a0af833caac9b38b9834517c9fa.zip |
Remove unnecessary logs
Diffstat (limited to 'server/middlewares/validators/pagination.ts')
-rw-r--r-- | server/middlewares/validators/pagination.ts | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/server/middlewares/validators/pagination.ts b/server/middlewares/validators/pagination.ts index ce371d6c1..79ddbbf18 100644 --- a/server/middlewares/validators/pagination.ts +++ b/server/middlewares/validators/pagination.ts | |||
@@ -1,7 +1,6 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { query } from 'express-validator' | 2 | import { query } from 'express-validator' |
3 | import { PAGINATION } from '@server/initializers/constants' | 3 | import { PAGINATION } from '@server/initializers/constants' |
4 | import { logger } from '../../helpers/logger' | ||
5 | import { areValidationErrors } from './shared' | 4 | import { areValidationErrors } from './shared' |
6 | 5 | ||
7 | const paginationValidator = paginationValidatorBuilder() | 6 | const paginationValidator = paginationValidatorBuilder() |
@@ -16,9 +15,7 @@ function paginationValidatorBuilder (tags: string[] = []) { | |||
16 | .isInt({ min: 0, max: PAGINATION.GLOBAL.COUNT.MAX }).withMessage(`Should have a number count (max: ${PAGINATION.GLOBAL.COUNT.MAX})`), | 15 | .isInt({ min: 0, max: PAGINATION.GLOBAL.COUNT.MAX }).withMessage(`Should have a number count (max: ${PAGINATION.GLOBAL.COUNT.MAX})`), |
17 | 16 | ||
18 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 17 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
19 | logger.debug('Checking pagination parameters', { parameters: req.query, tags }) | 18 | if (areValidationErrors(req, res, { tags })) return |
20 | |||
21 | if (areValidationErrors(req, res)) return | ||
22 | 19 | ||
23 | return next() | 20 | return next() |
24 | } | 21 | } |