1 import { body } from 'express-validator/check'
2 import * as express from 'express'
6 isEachRemoteRequestVideosValid,
7 isEachRemoteRequestVideosQaduValid,
8 isEachRemoteRequestVideosEventsValid
9 } from '../../../helpers'
10 import { checkErrors } from '../utils'
12 const remoteVideosValidator = [
13 body('data').custom(isEachRemoteRequestVideosValid),
15 (req: express.Request, res: express.Response, next: express.NextFunction) => {
16 logger.debug('Checking remoteVideos parameters', { parameters: req.body })
18 checkErrors(req, res, next)
22 const remoteQaduVideosValidator = [
23 body('data').custom(isEachRemoteRequestVideosQaduValid),
25 (req: express.Request, res: express.Response, next: express.NextFunction) => {
26 logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body })
28 checkErrors(req, res, next)
32 const remoteEventsVideosValidator = [
33 body('data').custom(isEachRemoteRequestVideosEventsValid),
35 (req: express.Request, res: express.Response, next: express.NextFunction) => {
36 logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })
38 checkErrors(req, res, next)
42 // ---------------------------------------------------------------------------
45 remoteVideosValidator,
46 remoteQaduVideosValidator,
47 remoteEventsVideosValidator