diff options
Diffstat (limited to 'server/middlewares/sort.ts')
-rw-r--r-- | server/middlewares/sort.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/middlewares/sort.ts b/server/middlewares/sort.ts index ab9ccf524..632b2fae4 100644 --- a/server/middlewares/sort.ts +++ b/server/middlewares/sort.ts | |||
@@ -1,16 +1,19 @@ | |||
1 | function setUsersSort (req, res, next) { | 1 | import 'express-validator' |
2 | import * as express from 'express' | ||
3 | |||
4 | function setUsersSort (req: express.Request, res: express.Response, next: express.NextFunction) { | ||
2 | if (!req.query.sort) req.query.sort = '-createdAt' | 5 | if (!req.query.sort) req.query.sort = '-createdAt' |
3 | 6 | ||
4 | return next() | 7 | return next() |
5 | } | 8 | } |
6 | 9 | ||
7 | function setVideoAbusesSort (req, res, next) { | 10 | function setVideoAbusesSort (req: express.Request, res: express.Response, next: express.NextFunction) { |
8 | if (!req.query.sort) req.query.sort = '-createdAt' | 11 | if (!req.query.sort) req.query.sort = '-createdAt' |
9 | 12 | ||
10 | return next() | 13 | return next() |
11 | } | 14 | } |
12 | 15 | ||
13 | function setVideosSort (req, res, next) { | 16 | function setVideosSort (req: express.Request, res: express.Response, next: express.NextFunction) { |
14 | if (!req.query.sort) req.query.sort = '-createdAt' | 17 | if (!req.query.sort) req.query.sort = '-createdAt' |
15 | 18 | ||
16 | return next() | 19 | return next() |