]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/middlewares/validators/remote/videos.ts
Remove ng2-completer
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / remote / videos.ts
1 import 'express-validator'
2 import * as express from 'express'
3
4 import { logger } from '../../../helpers'
5 import { checkErrors } from '../utils'
6
7 function remoteVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
8 req.checkBody('data').isEachRemoteRequestVideosValid()
9
10 logger.debug('Checking remoteVideos parameters', { parameters: req.body })
11
12 checkErrors(req, res, next)
13 }
14
15 function remoteQaduVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
16 req.checkBody('data').isEachRemoteRequestVideosQaduValid()
17
18 logger.debug('Checking remoteQaduVideos parameters', { parameters: req.body })
19
20 checkErrors(req, res, next)
21 }
22
23 function remoteEventsVideosValidator (req: express.Request, res: express.Response, next: express.NextFunction) {
24 req.checkBody('data').isEachRemoteRequestVideosEventsValid()
25
26 logger.debug('Checking remoteEventsVideos parameters', { parameters: req.body })
27
28 checkErrors(req, res, next)
29 }
30
31 // ---------------------------------------------------------------------------
32
33 export {
34 remoteVideosValidator,
35 remoteQaduVideosValidator,
36 remoteEventsVideosValidator
37 }