blob: f0b7274eba11ea244a600f6e0037bef71e0793e6 (
plain) (
tree)
|
|
'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
|