-const videoChannelsGetValidator = [
- param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
+const videoChannelsNameWithHostValidator = [
+ param('nameWithHost').exists().withMessage('Should have an video channel name with host'),
+
+ async (req: express.Request, res: express.Response, next: express.NextFunction) => {
+ logger.debug('Checking videoChannelsNameWithHostValidator parameters', { parameters: req.params })
+
+ if (areValidationErrors(req, res)) return
+
+ if (!await isVideoChannelNameWithHostExist(req.params.nameWithHost, res)) return
+
+ return next()
+ }
+]
+
+const localVideoChannelValidator = [
+ param('name').custom(isVideoChannelNameValid).withMessage('Should have a valid video channel name'),