import * as express from 'express'
import 'express-validator'
-import { SortType } from '../helpers/utils'
+import { SortType } from '../models/utils'
function setDefaultSort (req: express.Request, res: express.Response, next: express.NextFunction) {
if (!req.query.sort) req.query.sort = '-createdAt'
}
function setDefaultSearchSort (req: express.Request, res: express.Response, next: express.NextFunction) {
- if (!req.query.sort) req.query.sort = '-bestmatch'
+ if (!req.query.sort) req.query.sort = '-match'
return next()
}
function setBlacklistSort (req: express.Request, res: express.Response, next: express.NextFunction) {
- let newSort: SortType = { sortModel: undefined, sortValue: undefined }
+ let newSort: SortType = { sortModel: undefined, sortValue: '' }
if (!req.query.sort) req.query.sort = '-createdAt'