mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-06 03:50:26 +02:00
Server: add video abuse support
This commit is contained in:
parent
a6fd2b30bf
commit
55fa55a9be
32 changed files with 921 additions and 175 deletions
|
@ -6,29 +6,38 @@ const logger = require('../../helpers/logger')
|
|||
|
||||
const validatorsSort = {
|
||||
usersSort,
|
||||
videoAbusesSort,
|
||||
videosSort
|
||||
}
|
||||
|
||||
function usersSort (req, res, next) {
|
||||
const sortableColumns = constants.SORTABLE_COLUMNS.USERS
|
||||
|
||||
req.checkQuery('sort', 'Should have correct sortable column').optional().isIn(sortableColumns)
|
||||
checkSort(req, res, next, sortableColumns)
|
||||
}
|
||||
|
||||
logger.debug('Checking sort parameters', { parameters: req.query })
|
||||
function videoAbusesSort (req, res, next) {
|
||||
const sortableColumns = constants.SORTABLE_COLUMNS.VIDEO_ABUSES
|
||||
|
||||
checkErrors(req, res, next)
|
||||
checkSort(req, res, next, sortableColumns)
|
||||
}
|
||||
|
||||
function videosSort (req, res, next) {
|
||||
const sortableColumns = constants.SORTABLE_COLUMNS.VIDEOS
|
||||
|
||||
checkSort(req, res, next, sortableColumns)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = validatorsSort
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function checkSort (req, res, next, sortableColumns) {
|
||||
req.checkQuery('sort', 'Should have correct sortable column').optional().isIn(sortableColumns)
|
||||
|
||||
logger.debug('Checking sort parameters', { parameters: req.query })
|
||||
|
||||
checkErrors(req, res, next)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
module.exports = validatorsSort
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue