1
0
Fork 0
peertube/server/middlewares/sort.ts
2017-05-20 09:57:40 +02:00

25 lines
494 B
TypeScript

function setUsersSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdAt'
return next()
}
function setVideoAbusesSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdAt'
return next()
}
function setVideosSort (req, res, next) {
if (!req.query.sort) req.query.sort = '-createdAt'
return next()
}
// ---------------------------------------------------------------------------
export {
setUsersSort,
setVideoAbusesSort,
setVideosSort
}