aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/video-channels.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/video-channels.ts')
-rw-r--r--server/middlewares/validators/video-channels.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/middlewares/validators/video-channels.ts b/server/middlewares/validators/video-channels.ts
index 86bddde82..fe42105e8 100644
--- a/server/middlewares/validators/video-channels.ts
+++ b/server/middlewares/validators/video-channels.ts
@@ -5,7 +5,7 @@ import { isAccountIdExist } from '../../helpers/custom-validators/accounts'
5import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' 5import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
6import { 6import {
7 isVideoChannelDescriptionValid, isVideoChannelExist, 7 isVideoChannelDescriptionValid, isVideoChannelExist,
8 isVideoChannelNameValid 8 isVideoChannelNameValid, isVideoChannelSupportValid
9} from '../../helpers/custom-validators/video-channels' 9} from '../../helpers/custom-validators/video-channels'
10import { logger } from '../../helpers/logger' 10import { logger } from '../../helpers/logger'
11import { UserModel } from '../../models/account/user' 11import { UserModel } from '../../models/account/user'
@@ -27,7 +27,8 @@ const listVideoAccountChannelsValidator = [
27 27
28const videoChannelsAddValidator = [ 28const videoChannelsAddValidator = [
29 body('name').custom(isVideoChannelNameValid).withMessage('Should have a valid name'), 29 body('name').custom(isVideoChannelNameValid).withMessage('Should have a valid name'),
30 body('description').custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'), 30 body('description').optional().custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'),
31 body('support').optional().custom(isVideoChannelSupportValid).withMessage('Should have a valid support text'),
31 32
32 (req: express.Request, res: express.Response, next: express.NextFunction) => { 33 (req: express.Request, res: express.Response, next: express.NextFunction) => {
33 logger.debug('Checking videoChannelsAdd parameters', { parameters: req.body }) 34 logger.debug('Checking videoChannelsAdd parameters', { parameters: req.body })
@@ -42,6 +43,7 @@ const videoChannelsUpdateValidator = [
42 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'), 43 param('id').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid id'),
43 body('name').optional().custom(isVideoChannelNameValid).withMessage('Should have a valid name'), 44 body('name').optional().custom(isVideoChannelNameValid).withMessage('Should have a valid name'),
44 body('description').optional().custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'), 45 body('description').optional().custom(isVideoChannelDescriptionValid).withMessage('Should have a valid description'),
46 body('support').optional().custom(isVideoChannelSupportValid).withMessage('Should have a valid support text'),
45 47
46 async (req: express.Request, res: express.Response, next: express.NextFunction) => { 48 async (req: express.Request, res: express.Response, next: express.NextFunction) => {
47 logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body }) 49 logger.debug('Checking videoChannelsUpdate parameters', { parameters: req.body })