diff options
Diffstat (limited to 'server/middlewares/sort.js')
-rw-r--r-- | server/middlewares/sort.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/server/middlewares/sort.js b/server/middlewares/sort.js index 9f52290a6..f0b7274eb 100644 --- a/server/middlewares/sort.js +++ b/server/middlewares/sort.js | |||
@@ -1,7 +1,14 @@ | |||
1 | 'use strict' | 1 | 'use strict' |
2 | 2 | ||
3 | const sortMiddleware = { | 3 | const sortMiddleware = { |
4 | setVideosSort: setVideosSort | 4 | setUsersSort, |
5 | setVideosSort | ||
6 | } | ||
7 | |||
8 | function setUsersSort (req, res, next) { | ||
9 | if (!req.query.sort) req.query.sort = '-createdDate' | ||
10 | |||
11 | return next() | ||
5 | } | 12 | } |
6 | 13 | ||
7 | function setVideosSort (req, res, next) { | 14 | function setVideosSort (req, res, next) { |