aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-04 20:59:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-04 21:05:13 +0100
commit55fa55a9be566cca2ba95322f2ae23b434aed62a (patch)
treef51ef35c120ce8a928917a659418079538cdb8dc /server/middlewares/validators/videos.js
parenta6fd2b30bf717eec14972a2175354781f5f43e77 (diff)
downloadPeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.tar.gz
PeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.tar.zst
PeerTube-55fa55a9be566cca2ba95322f2ae23b434aed62a.zip
Server: add video abuse support
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