]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame_incremental - server/middlewares/sort.js
Server: remove encryption when seending requests to other pods
[github/Chocobozzz/PeerTube.git] / server / middlewares / sort.js
... / ...
CommitLineData
1'use strict'
2
3const sortMiddleware = {
4 setUsersSort,
5 setVideosSort
6}
7
8function setUsersSort (req, res, next) {
9 if (!req.query.sort) req.query.sort = '-createdDate'
10
11 return next()
12}
13
14function setVideosSort (req, res, next) {
15 if (!req.query.sort) req.query.sort = '-createdDate'
16
17 return next()
18}
19
20// ---------------------------------------------------------------------------
21
22module.exports = sortMiddleware