aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/sort.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/sort.js')
-rw-r--r--server/middlewares/sort.js9
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
3const sortMiddleware = { 3const sortMiddleware = {
4 setVideosSort: setVideosSort 4 setUsersSort,
5 setVideosSort
6}
7
8function setUsersSort (req, res, next) {
9 if (!req.query.sort) req.query.sort = '-createdDate'
10
11 return next()
5} 12}
6 13
7function setVideosSort (req, res, next) { 14function setVideosSort (req, res, next) {