mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-12-02 05:19:17 -06:00
29 lines
728 B
TypeScript
29 lines
728 B
TypeScript
import 'express-validator'
|
|
import * as express from 'express'
|
|
|
|
function setUsersSort (req: express.Request, res: express.Response, next: express.NextFunction) {
|
|
if (!req.query.sort) req.query.sort = '-createdAt'
|
|
|
|
return next()
|
|
}
|
|
|
|
function setVideoAbusesSort (req: express.Request, res: express.Response, next: express.NextFunction) {
|
|
if (!req.query.sort) req.query.sort = '-createdAt'
|
|
|
|
return next()
|
|
}
|
|
|
|
function setVideosSort (req: express.Request, res: express.Response, next: express.NextFunction) {
|
|
if (!req.query.sort) req.query.sort = '-createdAt'
|
|
|
|
return next()
|
|
}
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
export {
|
|
setUsersSort,
|
|
setVideoAbusesSort,
|
|
setVideosSort
|
|
}
|