From 6891696e0d7afe4186e41310c4e2d2091f029a4f Mon Sep 17 00:00:00 2001 From: TidusJar Date: Wed, 1 Aug 2018 13:41:17 +0100 Subject: [PATCH] Added a new API method to delete issue comments --- src/Ombi/Controllers/IssuesController.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Ombi/Controllers/IssuesController.cs b/src/Ombi/Controllers/IssuesController.cs index 7984785d4..07ee3216a 100644 --- a/src/Ombi/Controllers/IssuesController.cs +++ b/src/Ombi/Controllers/IssuesController.cs @@ -240,6 +240,18 @@ namespace Ombi.Controllers return await _issueComments.Add(newComment); } + /// + /// Deletes a comment on a issue + /// + [HttpDelete("comments/{id:int}")] + [PowerUser] + public async Task DeleteComment(int commentId) + { + var comment = await _issueComments.GetAll().FirstOrDefaultAsync(x => x.Id == commentId); + + await _issueComments.Delete(comment); + return true; + } [HttpPost("status")] public async Task UpdateStatus([FromBody] IssueStateViewModel model)