From ed1343857fcbfb97b6c55b48c3c679ff1f28ac1a Mon Sep 17 00:00:00 2001 From: "Matthew D. Groves" Date: Tue, 26 Sep 2023 10:35:06 -0400 Subject: [PATCH] #21 comment docs --- .../Articles/Controllers/CommentsController.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Conduit/Conduit.Web/Articles/Controllers/CommentsController.cs b/Conduit/Conduit.Web/Articles/Controllers/CommentsController.cs index 09106cd08f..73604637e8 100644 --- a/Conduit/Conduit.Web/Articles/Controllers/CommentsController.cs +++ b/Conduit/Conduit.Web/Articles/Controllers/CommentsController.cs @@ -79,6 +79,9 @@ public async Task AddComment([FromRoute] string slug, [FromBody] /// /// Article slug (required) /// Comments array + /// Successfully retrieved comments + /// Article wasn't found + /// Something went wrong while deleting the comment [HttpGet] [AllowAnonymous] [Route("/api/articles/{slug}/comments")] @@ -107,6 +110,16 @@ public async Task GetComments([FromRoute] string slug) return Ok(new { comments = response.CommentsView }); } + /// + /// Delete a comment from an article + /// + /// Article slug (required) + /// Comment ID (required) + /// Successfully deleted + /// Unauthorized, likely because credentials are incorrect or its not your comment + /// Article or comment wasn't found + /// Comment couldn't be deleted + /// Something went wrong while deleting the comment [HttpDelete] [Route("/api/articles/{slug}/comments/{commentId}")] [Authorize]