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 295ed05fa..ff18a99c2 100644
--- a/server/middlewares/validators/videos.js
+++ b/server/middlewares/validators/videos.js
@@ -11,7 +11,9 @@ const validatorsVideos = {
11 videosUpdate, 11 videosUpdate,
12 videosGet, 12 videosGet,
13 videosRemove, 13 videosRemove,
14 videosSearch 14 videosSearch,
15
16 videoAbuseReport
15} 17}
16 18
17function videosAdd (req, res, next) { 19function videosAdd (req, res, next) {
@@ -97,6 +99,17 @@ function videosSearch (req, res, next) {
97 checkErrors(req, res, next) 99 checkErrors(req, res, next)
98} 100}
99 101
102function videoAbuseReport (req, res, next) {
103 req.checkParams('id', 'Should have a valid id').notEmpty().isUUID(4)
104 req.checkBody('reason', 'Should have a valid reason').isVideoAbuseReasonValid()
105
106 logger.debug('Checking videoAbuseReport parameters', { parameters: req.body })
107
108 checkErrors(req, res, function () {
109 checkVideoExists(req.params.id, res, next)
110 })
111}
112
100// --------------------------------------------------------------------------- 113// ---------------------------------------------------------------------------
101 114
102module.exports = validatorsVideos 115module.exports = validatorsVideos