1
0
Fork 0
peertube/server/middlewares/sort.js
2016-10-02 12:19:02 +02:00

22 lines
419 B
JavaScript

'use strict'
const sortMiddleware = {
setUsersSort,
setVideosSort
}
function setUsersSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdDate'
return next()
}
function setVideosSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdDate'
return next()
}
// ---------------------------------------------------------------------------
module.exports = sortMiddleware