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, 8 insertions, 1 deletions
diff --git a/server/middlewares/sort.ts b/server/middlewares/sort.ts
index 279b29e65..7b60920de 100644
--- a/server/middlewares/sort.ts
+++ b/server/middlewares/sort.ts
@@ -10,6 +10,12 @@ function setUsersSort (req: express.Request, res: express.Response, next: expres
10 return next() 10 return next()
11} 11}
12 12
13function setJobsSort (req: express.Request, res: express.Response, next: express.NextFunction) {
14 if (!req.query.sort) req.query.sort = '-createdAt'
15
16 return next()
17}
18
13function setVideoAbusesSort (req: express.Request, res: express.Response, next: express.NextFunction) { 19function setVideoAbusesSort (req: express.Request, res: express.Response, next: express.NextFunction) {
14 if (!req.query.sort) req.query.sort = '-createdAt' 20 if (!req.query.sort) req.query.sort = '-createdAt'
15 21
@@ -70,5 +76,6 @@ export {
70 setVideosSort, 76 setVideosSort,
71 setBlacklistSort, 77 setBlacklistSort,
72 setFollowersSort, 78 setFollowersSort,
73 setFollowingSort 79 setFollowingSort,
80 setJobsSort
74} 81}