aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos.js')
-rw-r--r--server/middlewares/validators/videos.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/server/middlewares/validators/videos.js b/server/middlewares/validators/videos.js
index 5c3f3ecf3..7dc79c56f 100644
--- a/server/middlewares/validators/videos.js
+++ b/server/middlewares/validators/videos.js
@@ -13,7 +13,9 @@ const validatorsVideos = {
13 videosRemove, 13 videosRemove,
14 videosSearch, 14 videosSearch,
15 15
16 videoAbuseReport 16 videoAbuseReport,
17
18 videoRate
17} 19}
18 20
19function videosAdd (req, res, next) { 21function videosAdd (req, res, next) {
@@ -119,6 +121,17 @@ function videoAbuseReport (req, res, next) {
119 }) 121 })
120} 122}
121 123
124function videoRate (req, res, next) {
125 req.checkParams('id', 'Should have a valid id').notEmpty().isUUID(4)
126 req.checkBody('rating', 'Should have a valid rate type').isVideoRatingTypeValid()
127
128 logger.debug('Checking videoRate parameters', { parameters: req.body })
129
130 checkErrors(req, res, function () {
131 checkVideoExists(req.params.id, res, next)
132 })
133}
134
122// --------------------------------------------------------------------------- 135// ---------------------------------------------------------------------------
123 136
124module.exports = validatorsVideos 137module.exports = validatorsVideos