aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-04 11:48:12 +0100
committerChocobozzz <me@florianbigard.com>2019-12-04 11:48:12 +0100
commitc883db6d038a8510205f5f13ef46fb5a1c9e8288 (patch)
treed8becd3b5cf3bddf14559f062d7ca4f96d1b25c3 /server/middlewares/validators/videos
parentb5206dfc455c119b0dcb897bd7144be6ea4d999d (diff)
downloadPeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.tar.gz
PeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.tar.zst
PeerTube-c883db6d038a8510205f5f13ef46fb5a1c9e8288.zip
Move deleted comment on new follow tests
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r--server/middlewares/validators/videos/video-comments.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/video-comments.ts b/server/middlewares/validators/videos/video-comments.ts
index 1d81eb5d8..eb07d9430 100644
--- a/server/middlewares/validators/videos/video-comments.ts
+++ b/server/middlewares/validators/videos/video-comments.ts
@@ -189,6 +189,13 @@ function isVideoCommentsEnabled (video: MVideo, res: express.Response) {
189} 189}
190 190
191function checkUserCanDeleteVideoComment (user: MUser, videoComment: MCommentOwner, res: express.Response) { 191function checkUserCanDeleteVideoComment (user: MUser, videoComment: MCommentOwner, res: express.Response) {
192 if (videoComment.isDeleted()) {
193 res.status(409)
194 .json({ error: 'This comment is already deleted' })
195 .end()
196 return false
197 }
198
192 const account = videoComment.Account 199 const account = videoComment.Account
193 if (user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) === false && account.userId !== user.id) { 200 if (user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) === false && account.userId !== user.id) {
194 res.status(403) 201 res.status(403)