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.ts9
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 @@
1function setUsersSort (req, res, next) { 1import 'express-validator'
2import * as express from 'express'
3
4function 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
7function setVideoAbusesSort (req, res, next) { 10function 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
13function setVideosSort (req, res, next) { 16function 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()