diff options
Diffstat (limited to 'server/middlewares/sort.ts')
-rw-r--r-- | server/middlewares/sort.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/middlewares/sort.ts b/server/middlewares/sort.ts index 7b60920de..5d2a43acc 100644 --- a/server/middlewares/sort.ts +++ b/server/middlewares/sort.ts | |||
@@ -1,8 +1,6 @@ | |||
1 | import 'express-validator' | ||
2 | import * as express from 'express' | 1 | import * as express from 'express' |
3 | 2 | import 'express-validator' | |
4 | import { SortType } from '../helpers' | 3 | import { SortType } from '../helpers' |
5 | import { database } from '../initializers' | ||
6 | 4 | ||
7 | function setUsersSort (req: express.Request, res: express.Response, next: express.NextFunction) { | 5 | function setUsersSort (req: express.Request, res: express.Response, next: express.NextFunction) { |
8 | if (!req.query.sort) req.query.sort = '-createdAt' | 6 | if (!req.query.sort) req.query.sort = '-createdAt' |
@@ -57,7 +55,7 @@ function setBlacklistSort (req: express.Request, res: express.Response, next: ex | |||
57 | // If we want to sort onto the BlacklistedVideos relation, we won't specify it in the query parameter ... | 55 | // If we want to sort onto the BlacklistedVideos relation, we won't specify it in the query parameter ... |
58 | newSort.sortModel = undefined | 56 | newSort.sortModel = undefined |
59 | } else { | 57 | } else { |
60 | newSort.sortModel = database.Video | 58 | newSort.sortModel = 'Video' |
61 | } | 59 | } |
62 | 60 | ||
63 | newSort.sortValue = req.query.sort | 61 | newSort.sortValue = req.query.sort |