PeerTube/server/middlewares/sort.js

16 lines
302 B
JavaScript
Raw Normal View History

2016-05-17 21:03:00 +02: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