-const videosSearchValidator = [
- query('search').not().isEmpty().withMessage('Should have a valid search'),
-
- (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videosSearch parameters', { parameters: req.params })
-
- if (areValidationErrors(req, res)) return
-
- return next()
- }
-]
-
-const videoAbuseReportValidator = [
- param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
- body('reason').custom(isVideoAbuseReasonValid).withMessage('Should have a valid reason'),
-
- async (req: express.Request, res: express.Response, next: express.NextFunction) => {
- logger.debug('Checking videoAbuseReport parameters', { parameters: req.body })
-
- if (areValidationErrors(req, res)) return
- if (!await isVideoExist(req.params.id, res)) return
-
- return next()
- }
-]
-