aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-07 17:03:56 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-07 17:05:23 +0100
commit8e7f08b5a5e65195ad6dd3d7850fda57021421f3 (patch)
tree1ee2bff1a5a51643e6b86c6f21e4766013a9213d /server/middlewares/validators
parent27e1a06c331278e5d37bc5172ee7e4fc968e4b5e (diff)
downloadPeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.tar.gz
PeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.tar.zst
PeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.zip
Make some fields optional when uploading a video
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos.ts b/server/middlewares/validators/videos.ts
index ee2ac50c8..10625e41d 100644
--- a/server/middlewares/validators/videos.ts
+++ b/server/middlewares/validators/videos.ts
@@ -31,11 +31,11 @@ const videosAddValidator = [
31 + CONSTRAINTS_FIELDS.VIDEOS.EXTNAME.join(', ') 31 + CONSTRAINTS_FIELDS.VIDEOS.EXTNAME.join(', ')
32 ), 32 ),
33 body('name').custom(isVideoNameValid).withMessage('Should have a valid name'), 33 body('name').custom(isVideoNameValid).withMessage('Should have a valid name'),
34 body('category').custom(isVideoCategoryValid).withMessage('Should have a valid category'), 34 body('category').optional().custom(isVideoCategoryValid).withMessage('Should have a valid category'),
35 body('licence').custom(isVideoLicenceValid).withMessage('Should have a valid licence'), 35 body('licence').optional().custom(isVideoLicenceValid).withMessage('Should have a valid licence'),
36 body('language').optional().custom(isVideoLanguageValid).withMessage('Should have a valid language'), 36 body('language').optional().custom(isVideoLanguageValid).withMessage('Should have a valid language'),
37 body('nsfw').custom(isVideoNSFWValid).withMessage('Should have a valid NSFW attribute'), 37 body('nsfw').custom(isVideoNSFWValid).withMessage('Should have a valid NSFW attribute'),
38 body('description').custom(isVideoDescriptionValid).withMessage('Should have a valid description'), 38 body('description').optional().custom(isVideoDescriptionValid).withMessage('Should have a valid description'),
39 body('channelId').custom(isIdValid).withMessage('Should have correct video channel id'), 39 body('channelId').custom(isIdValid).withMessage('Should have correct video channel id'),
40 body('privacy').custom(isVideoPrivacyValid).withMessage('Should have correct video privacy'), 40 body('privacy').custom(isVideoPrivacyValid).withMessage('Should have correct video privacy'),
41 body('tags').optional().custom(isVideoTagsValid).withMessage('Should have correct tags'), 41 body('tags').optional().custom(isVideoTagsValid).withMessage('Should have correct tags'),