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

35 lines
944 B
TypeScript
Raw Normal View History

2017-05-15 15:22:03 -05:00
import { logger } from '../../../helpers'
import { checkErrors } from '../utils'
2017-01-04 13:59:23 -06:00
2017-05-15 15:22:03 -05:00
function remoteVideosValidator (req, res, next) {
2017-01-04 13:59:23 -06:00
req.checkBody('data').isEachRemoteRequestVideosValid()
logger.debug('Checking remoteVideos parameters', { parameters: req.body })
checkErrors(req, res, next)
}
2017-05-15 15:22:03 -05:00
function remoteQaduVideosValidator (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-05-15 15:22:03 -05:00
function remoteEventsVideosValidator (req, res, next) {
2017-02-26 11:57:33 -06:00
req.checkBody('data').isEachRemoteRequestVideosEventsValid()
logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })
checkErrors(req, res, next)
}
2017-05-15 15:22:03 -05:00
2017-01-04 13:59:23 -06:00
// ---------------------------------------------------------------------------
2017-05-15 15:22:03 -05:00
export {
remoteVideosValidator,
remoteQaduVideosValidator,
remoteEventsVideosValidator
}