diff options
Diffstat (limited to 'server/middlewares/validators/videos/video-live.ts')
-rw-r--r-- | server/middlewares/validators/videos/video-live.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos/video-live.ts b/server/middlewares/validators/videos/video-live.ts index 3a73e1272..ec4c7f32f 100644 --- a/server/middlewares/validators/videos/video-live.ts +++ b/server/middlewares/validators/videos/video-live.ts | |||
@@ -14,6 +14,7 @@ import { VideoModel } from '@server/models/video/video' | |||
14 | import { Hooks } from '@server/lib/plugins/hooks' | 14 | import { Hooks } from '@server/lib/plugins/hooks' |
15 | import { isLocalLiveVideoAccepted } from '@server/lib/moderation' | 15 | import { isLocalLiveVideoAccepted } from '@server/lib/moderation' |
16 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | 16 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' |
17 | import { CONSTRAINTS_FIELDS } from '@server/initializers/constants' | ||
17 | 18 | ||
18 | const videoLiveGetValidator = [ | 19 | const videoLiveGetValidator = [ |
19 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), | 20 | param('videoId').custom(isIdOrUUIDValid).not().isEmpty().withMessage('Should have a valid videoId'), |
@@ -43,7 +44,9 @@ const videoLiveAddValidator = getCommonVideoEditAttributes().concat([ | |||
43 | .custom(isIdValid).withMessage('Should have correct video channel id'), | 44 | .custom(isIdValid).withMessage('Should have correct video channel id'), |
44 | 45 | ||
45 | body('name') | 46 | body('name') |
46 | .custom(isVideoNameValid).withMessage('Should have a valid name'), | 47 | .custom(isVideoNameValid).withMessage( |
48 | `Should have a video name between ${CONSTRAINTS_FIELDS.VIDEOS.NAME.min} and ${CONSTRAINTS_FIELDS.VIDEOS.NAME.max} characters long` | ||
49 | ), | ||
47 | 50 | ||
48 | body('saveReplay') | 51 | body('saveReplay') |
49 | .optional() | 52 | .optional() |