aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/sort.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/sort.ts')
-rw-r--r--server/middlewares/sort.ts6
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 @@
1import 'express-validator'
2import * as express from 'express' 1import * as express from 'express'
3 2import 'express-validator'
4import { SortType } from '../helpers' 3import { SortType } from '../helpers'
5import { database } from '../initializers'
6 4
7function setUsersSort (req: express.Request, res: express.Response, next: express.NextFunction) { 5function 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