aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-live.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-05-31 20:46:22 +0200
committerRigel Kent <sendmemail@rigelk.eu>2021-05-31 20:47:59 +0200
commit7dab0bd698ba1d78995b58325d0dd78257278582 (patch)
tree063c71c1f1e7a0766f915acdde6c393977358aef /server/middlewares/validators/videos/video-live.ts
parent70330f63236a3200829f2ba76c10cca88326b858 (diff)
downloadPeerTube-7dab0bd698ba1d78995b58325d0dd78257278582.tar.gz
PeerTube-7dab0bd698ba1d78995b58325d0dd78257278582.tar.zst
PeerTube-7dab0bd698ba1d78995b58325d0dd78257278582.zip
improve api param message for video names and tags
closes #4026
Diffstat (limited to 'server/middlewares/validators/videos/video-live.ts')
-rw-r--r--server/middlewares/validators/videos/video-live.ts5
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'
14import { Hooks } from '@server/lib/plugins/hooks' 14import { Hooks } from '@server/lib/plugins/hooks'
15import { isLocalLiveVideoAccepted } from '@server/lib/moderation' 15import { isLocalLiveVideoAccepted } from '@server/lib/moderation'
16import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' 16import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes'
17import { CONSTRAINTS_FIELDS } from '@server/initializers/constants'
17 18
18const videoLiveGetValidator = [ 19const 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()