1
0
Fork 0
peertube/server/middlewares/sort.js
2016-05-17 21:03:00 +02:00

15 lines
302 B
JavaScript

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