aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-04-16 14:22:27 +0200
committerRigel Kent <par@rigelk.eu>2020-05-01 16:41:02 +0200
commit68d19a0ace01cb7a3550da420d27663e2db1b98d (patch)
treefcdac5341001b9e6d15ddd0ca8239372ec2b3053 /server/middlewares
parent165ee2929bc76fc7f9985ae81cc33736820c7865 (diff)
downloadPeerTube-68d19a0ace01cb7a3550da420d27663e2db1b98d.tar.gz
PeerTube-68d19a0ace01cb7a3550da420d27663e2db1b98d.tar.zst
PeerTube-68d19a0ace01cb7a3550da420d27663e2db1b98d.zip
Make sure a report doesn't get deleted upon the deletion of its video
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/videos/video-abuses.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/video-abuses.ts b/server/middlewares/validators/videos/video-abuses.ts
index a4aef4024..7c316fe13 100644
--- a/server/middlewares/validators/videos/video-abuses.ts
+++ b/server/middlewares/validators/videos/video-abuses.ts
@@ -32,8 +32,7 @@ const videoAbuseGetValidator = [
32 logger.debug('Checking videoAbuseGetValidator parameters', { parameters: req.body }) 32 logger.debug('Checking videoAbuseGetValidator parameters', { parameters: req.body })
33 33
34 if (areValidationErrors(req, res)) return 34 if (areValidationErrors(req, res)) return
35 if (!await doesVideoExist(req.params.videoId, res)) return 35 if (!await doesVideoAbuseExist(req.params.id, req.params.videoId, res)) return
36 if (!await doesVideoAbuseExist(req.params.id, res.locals.videoAll.id, res)) return
37 36
38 return next() 37 return next()
39 } 38 }
@@ -53,8 +52,7 @@ const videoAbuseUpdateValidator = [
53 logger.debug('Checking videoAbuseUpdateValidator parameters', { parameters: req.body }) 52 logger.debug('Checking videoAbuseUpdateValidator parameters', { parameters: req.body })
54 53
55 if (areValidationErrors(req, res)) return 54 if (areValidationErrors(req, res)) return
56 if (!await doesVideoExist(req.params.videoId, res)) return 55 if (!await doesVideoAbuseExist(req.params.id, req.params.videoId, res)) return
57 if (!await doesVideoAbuseExist(req.params.id, res.locals.videoAll.id, res)) return
58 56
59 return next() 57 return next()
60 } 58 }