diff options
author | Chocobozzz <me@florianbigard.com> | 2017-12-12 17:53:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2017-12-13 16:50:33 +0100 |
commit | 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 (patch) | |
tree | e5ca358287fca6ecacce83defcf23af1e8e9f419 /server/middlewares/sort.ts | |
parent | c893d4514e6ecbf282c7985fe5f82b8acd8a1137 (diff) | |
download | PeerTube-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.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 |