aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/sort.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/sort.ts')
-rw-r--r--server/middlewares/validators/sort.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/middlewares/validators/sort.ts b/server/middlewares/validators/sort.ts
index 6fea41bb8..636f68885 100644
--- a/server/middlewares/validators/sort.ts
+++ b/server/middlewares/validators/sort.ts
@@ -1,9 +1,9 @@
1import { query } from 'express-validator/check' 1import { query } from 'express-validator/check'
2import * as express from 'express' 2import * as express from 'express'
3 3
4import { checkErrors } from './utils'
5import { logger } from '../../helpers' 4import { logger } from '../../helpers'
6import { SORTABLE_COLUMNS } from '../../initializers' 5import { SORTABLE_COLUMNS } from '../../initializers'
6import { areValidationErrors } from './utils'
7 7
8// Initialize constants here for better performances 8// Initialize constants here for better performances
9const SORTABLE_USERS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.USERS) 9const SORTABLE_USERS_COLUMNS = createSortableColumns(SORTABLE_COLUMNS.USERS)
@@ -43,7 +43,9 @@ function checkSort (sortableColumns: string[]) {
43 (req: express.Request, res: express.Response, next: express.NextFunction) => { 43 (req: express.Request, res: express.Response, next: express.NextFunction) => {
44 logger.debug('Checking sort parameters', { parameters: req.query }) 44 logger.debug('Checking sort parameters', { parameters: req.query })
45 45
46 checkErrors(req, res, next) 46 if (areValidationErrors(req, res)) return
47
48 return next()
47 } 49 }
48 ] 50 ]
49} 51}