aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/sort.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2017-12-12 17:53:50 +0100
committerChocobozzz <me@florianbigard.com>2017-12-13 16:50:33 +0100
commit3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch)
treee5ca358287fca6ecacce83defcf23af1e8e9f419 /server/middlewares/sort.ts
parentc893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff)
downloadPeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.gz
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.tar.zst
PeerTube-3fd3ab2d34d512b160a5e6084d7609be7b4f4452.zip
Move models to typescript-sequelize
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