aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos/video-comments.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos/video-comments.ts')
-rw-r--r--server/middlewares/validators/videos/video-comments.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts
index 96d956035..698afdbd1 100644
--- a/server/middlewares/validators/videos/video-comments.ts
+++ b/server/middlewares/validators/videos/video-comments.ts
@@ -91,12 +91,7 @@ const addVideoCommentThreadValidator = [
91 if (areValidationErrors(req, res)) return 91 if (areValidationErrors(req, res)) return
92 if (!await doesVideoExist(req.params.videoId, res)) return 92 if (!await doesVideoExist(req.params.videoId, res)) return
93 93
94 if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) { 94 if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) return
95 return res.fail({
96 status: HttpStatusCode.FORBIDDEN_403,
97 message: 'Cannot access to this ressource'
98 })
99 }
100 95
101 if (!isVideoCommentsEnabled(res.locals.videoAll, res)) return 96 if (!isVideoCommentsEnabled(res.locals.videoAll, res)) return
102 if (!await isVideoCommentAccepted(req, res, res.locals.videoAll, false)) return 97 if (!await isVideoCommentAccepted(req, res, res.locals.videoAll, false)) return
@@ -118,12 +113,7 @@ const addVideoCommentReplyValidator = [
118 if (areValidationErrors(req, res)) return 113 if (areValidationErrors(req, res)) return
119 if (!await doesVideoExist(req.params.videoId, res)) return 114 if (!await doesVideoExist(req.params.videoId, res)) return
120 115
121 if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) { 116 if (!await checkCanSeeVideoIfPrivate(req, res, res.locals.videoAll)) return
122 return res.fail({
123 status: HttpStatusCode.FORBIDDEN_403,
124 message: 'Cannot access to this ressource'
125 })
126 }
127 117
128 if (!isVideoCommentsEnabled(res.locals.videoAll, res)) return 118 if (!isVideoCommentsEnabled(res.locals.videoAll, res)) return
129 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoAll, res)) return 119 if (!await doesVideoCommentExist(req.params.commentId, res.locals.videoAll, res)) return