aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/remote/videos.ts
blob: 2037c0085e98b9cf71f2e44b673c6e9bdc3b84f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import 'express-validator'
import * as express from 'express'

import { logger } from '../../../helpers'
import { checkErrors } from '../utils'

function remoteVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
  req.checkBody('data').isEachRemoteRequestVideosValid()

  logger.debug('Checking remoteVideos parameters', { parameters: req.body })

  checkErrors(req, res, next)
}

function remoteQaduVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
  req.checkBody('data').isEachRemoteRequestVideosQaduValid()

  logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body })

  checkErrors(req, res, next)
}

function remoteEventsVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
  req.checkBody('data').isEachRemoteRequestVideosEventsValid()

  logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })

  checkErrors(req, res, next)
}

// ---------------------------------------------------------------------------

export {
  remoteVideosValidator,
  remoteQaduVideosValidator,
  remoteEventsVideosValidator
}