aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index c5c45fe58..e181aebdb 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -55,8 +55,13 @@ const videosAddValidator = [
55 .customSanitizer(toValueOrNull) 55 .customSanitizer(toValueOrNull)
56 .custom(isVideoLanguageValid).withMessage('Should have a valid language'), 56 .custom(isVideoLanguageValid).withMessage('Should have a valid language'),
57 body('nsfw') 57 body('nsfw')
58 .optional()
58 .toBoolean() 59 .toBoolean()
59 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), 60 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'),
61 body('waitTranscoding')
62 .optional()
63 .toBoolean()
64 .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'),
60 body('description') 65 body('description')
61 .optional() 66 .optional()
62 .customSanitizer(toValueOrNull) 67 .customSanitizer(toValueOrNull)
@@ -70,6 +75,7 @@ const videosAddValidator = [
70 .customSanitizer(toValueOrNull) 75 .customSanitizer(toValueOrNull)
71 .custom(isVideoTagsValid).withMessage('Should have correct tags'), 76 .custom(isVideoTagsValid).withMessage('Should have correct tags'),
72 body('commentsEnabled') 77 body('commentsEnabled')
78 .optional()
73 .toBoolean() 79 .toBoolean()
74 .custom(isBooleanValid).withMessage('Should have comments enabled boolean'), 80 .custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
75 body('privacy') 81 body('privacy')
@@ -149,6 +155,10 @@ const videosUpdateValidator = [
149 .optional() 155 .optional()
150 .toBoolean() 156 .toBoolean()
151 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'), 157 .custom(isBooleanValid).withMessage('Should have a valid NSFW attribute'),
158 body('waitTranscoding')
159 .optional()
160 .toBoolean()
161 .custom(isBooleanValid).withMessage('Should have a valid wait transcoding attribute'),
152 body('privacy') 162 body('privacy')
153 .optional() 163 .optional()
154 .toInt() 164 .toInt()