diff options
Diffstat (limited to 'server/middlewares/validators/sort.ts')
-rw-r--r-- | server/middlewares/validators/sort.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/middlewares/validators/sort.ts b/server/middlewares/validators/sort.ts index 269f1be53..7d0639107 100644 --- a/server/middlewares/validators/sort.ts +++ b/server/middlewares/validators/sort.ts | |||
@@ -1,6 +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 { logger } from '@server/helpers/logger' | 3 | |
4 | import { SORTABLE_COLUMNS } from '../../initializers/constants' | 4 | import { SORTABLE_COLUMNS } from '../../initializers/constants' |
5 | import { areValidationErrors } from './shared' | 5 | import { areValidationErrors } from './shared' |
6 | 6 | ||
@@ -15,9 +15,7 @@ function checkSort (sortableColumns: string[], tags: string[] = []) { | |||
15 | .isIn(sortableColumns), | 15 | .isIn(sortableColumns), |
16 | 16 | ||
17 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | 17 | (req: express.Request, res: express.Response, next: express.NextFunction) => { |
18 | logger.debug('Checking sort parameters', { parameters: req.query, tags }) | 18 | if (areValidationErrors(req, res, { tags })) return |
19 | |||
20 | if (areValidationErrors(req, res)) return | ||
21 | 19 | ||
22 | return next() | 20 | return next() |
23 | } | 21 | } |