]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/sort.js
Server: optimize function to see if there are users or not
[github/Chocobozzz/PeerTube.git] / server / middlewares / sort.js
CommitLineData
a877d5ac
C
1'use strict'
2
3const sortMiddleware = {
4 setVideosSort: setVideosSort
5}
6
7function setVideosSort (req, res, next) {
8 if (!req.query.sort) req.query.sort = '-createdDate'
9
10 return next()
11}
12
13// ---------------------------------------------------------------------------
14
15module.exports = sortMiddleware