mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
reqValidators --> validators
This commit is contained in:
parent
69b0a27cbb
commit
fc51fde048
13 changed files with 54 additions and 53 deletions
23
server/middlewares/validators/sort.js
Normal file
23
server/middlewares/validators/sort.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
'use strict'
|
||||
|
||||
const checkErrors = require('./utils').checkErrors
|
||||
const constants = require('../../initializers/constants')
|
||||
const logger = require('../../helpers/logger')
|
||||
|
||||
const validatorsSort = {
|
||||
videosSort: videosSort
|
||||
}
|
||||
|
||||
function videosSort (req, res, next) {
|
||||
const sortableColumns = constants.SORTABLE_COLUMNS.VIDEOS
|
||||
|
||||
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