aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-03-08 21:35:43 +0100
commitd38b82810638b9f664c9016fac2684454c273a77 (patch)
tree9465c367e5033675309efca4d66790c6fdd5230d /server/middlewares/validators/videos.js
parent8f9064432122cba0f518a24ac4378357dadec589 (diff)
downloadPeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.gz
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.tar.zst
PeerTube-d38b82810638b9f664c9016fac2684454c273a77.zip
Add like/dislike system for videos
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