diff options
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/videos.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js index 4fe6dcd8b..5c3f3ecf3 100644 --- a/server/middlewares/validators/videos.js +++ b/server/middlewares/validators/videos.js | |||
@@ -17,9 +17,7 @@ const validatorsVideos = { | |||
17 | } | 17 | } |
18 | 18 | ||
19 | function videosAdd (req, res, next) { | 19 | function videosAdd (req, res, next) { |
20 | req.checkFiles('videofile[0].originalname', 'Should have an input video').notEmpty() | 20 | req.checkBody('videofile', 'Should have a valid file').isVideoFile(req.files) |
21 | // TODO: move to constants and function | ||
22 | req.checkFiles('videofile[0].mimetype', 'Should have a correct mime type').matches(/video\/(webm)|(mp4)|(ogg)/i) | ||
23 | req.checkBody('name', 'Should have a valid name').isVideoNameValid() | 21 | req.checkBody('name', 'Should have a valid name').isVideoNameValid() |
24 | req.checkBody('description', 'Should have a valid description').isVideoDescriptionValid() | 22 | req.checkBody('description', 'Should have a valid description').isVideoDescriptionValid() |
25 | req.checkBody('tags', 'Should have correct tags').isVideoTagsValid() | 23 | req.checkBody('tags', 'Should have correct tags').isVideoTagsValid() |