From 55fa55a9be566cca2ba95322f2ae23b434aed62a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 4 Jan 2017 20:59:23 +0100 Subject: Server: add video abuse support --- server/middlewares/sort.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/middlewares/sort.js') diff --git a/server/middlewares/sort.js b/server/middlewares/sort.js index 477e10571..39e167265 100644 --- a/server/middlewares/sort.js +++ b/server/middlewares/sort.js @@ -2,6 +2,7 @@ const sortMiddleware = { setUsersSort, + setVideoAbusesSort, setVideosSort } @@ -11,6 +12,12 @@ function setUsersSort (req, res, next) { 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' -- cgit v1.2.3