3 const checkErrors = require('./utils').checkErrors
4 const constants = require('../../initializers/constants')
5 const logger = require('../../helpers/logger')
7 const validatorsSort = {
11 function videosSort (req, res, next) {
12 const sortableColumns = constants.SORTABLE_COLUMNS.VIDEOS
14 req.checkQuery('sort', 'Should have correct sortable column').optional().isIn(sortableColumns)
16 logger.debug('Checking sort parameters', { parameters: req.query })
18 checkErrors(req, res, next)
21 // ---------------------------------------------------------------------------
23 module.exports = validatorsSort