PeerTube/server/middlewares/sort.js

16 lines
302 B
JavaScript
Raw Normal View History

2016-05-17 14:03:00 -05:00
'use strict'
const sortMiddleware = {
setVideosSort: setVideosSort
}
function setVideosSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdDate'
return next()
}
// ---------------------------------------------------------------------------
module.exports = sortMiddleware