aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/remote/videos.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/remote/videos.ts')
-rw-r--r--server/middlewares/validators/remote/videos.ts45
1 files changed, 28 insertions, 17 deletions
diff --git a/server/middlewares/validators/remote/videos.ts b/server/middlewares/validators/remote/videos.ts
index 2037c0085..e4682a60b 100644
--- a/server/middlewares/validators/remote/videos.ts
+++ b/server/middlewares/validators/remote/videos.ts
@@ -1,32 +1,43 @@
1import 'express-validator' 1import { body } from 'express-validator/check'
2import * as express from 'express' 2import * as express from 'express'
3 3
4import { logger } from '../../../helpers' 4import {
5 logger,
6 isEachRemoteRequestVideosValid,
7 isEachRemoteRequestVideosQaduValid,
8 isEachRemoteRequestVideosEventsValid
9} from '../../../helpers'
5import { checkErrors } from '../utils' 10import { checkErrors } from '../utils'
6 11
7function remoteVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { 12const remoteVideosValidator = [
8 req.checkBody('data').isEachRemoteRequestVideosValid() 13 body('data').custom(isEachRemoteRequestVideosValid),
9 14
10 logger.debug('Checking remoteVideos parameters', { parameters: req.body }) 15 (req: express.Request, res: express.Response, next: express.NextFunction) => {
16 logger.debug('Checking remoteVideos parameters', { parameters: req.body })
11 17
12 checkErrors(req, res, next) 18 checkErrors(req, res, next)
13} 19 }
20]
14 21
15function remoteQaduVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { 22const remoteQaduVideosValidator = [
16 req.checkBody('data').isEachRemoteRequestVideosQaduValid() 23 body('data').custom(isEachRemoteRequestVideosQaduValid),
17 24
18 logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body }) 25 (req: express.Request, res: express.Response, next: express.NextFunction) => {
26 logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body })
19 27
20 checkErrors(req, res, next) 28 checkErrors(req, res, next)
21} 29 }
30]
22 31
23function remoteEventsVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) { 32const remoteEventsVideosValidator = [
24 req.checkBody('data').isEachRemoteRequestVideosEventsValid() 33 body('data').custom(isEachRemoteRequestVideosEventsValid),
25 34
26 logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body }) 35 (req: express.Request, res: express.Response, next: express.NextFunction) => {
36 logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })
27 37
28 checkErrors(req, res, next) 38 checkErrors(req, res, next)
29} 39 }
40]
30 41
31// --------------------------------------------------------------------------- 42// ---------------------------------------------------------------------------
32 43