PeerTube/server/middlewares/validators/remote/videos.js

38 lines
989 B
JavaScript
Raw Normal View History

2017-01-04 13:59:23 -06:00
'use strict'
const checkErrors = require('../utils').checkErrors
const logger = require('../../../helpers/logger')
const validatorsRemoteVideos = {
remoteVideos,
2017-02-26 11:57:33 -06:00
remoteQaduVideos,
remoteEventsVideos
2017-01-04 13:59:23 -06:00
}
function remoteVideos (req, res, next) {
req.checkBody('data').isEachRemoteRequestVideosValid()
logger.debug('Checking remoteVideos parameters', { parameters: req.body })
checkErrors(req, res, next)
}
function remoteQaduVideos (req, res, next) {
req.checkBody('data').isEachRemoteRequestVideosQaduValid()
2017-02-26 11:57:33 -06:00
logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body })
checkErrors(req, res, next)
}
2017-02-26 11:57:33 -06:00
function remoteEventsVideos (req, res, next) {
req.checkBody('data').isEachRemoteRequestVideosEventsValid()
logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })
checkErrors(req, res, next)
}
2017-01-04 13:59:23 -06:00
// ---------------------------------------------------------------------------
module.exports = validatorsRemoteVideos