Skip to content

Commit

Permalink
#21 comment docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mgroves committed Sep 26, 2023
1 parent efe80c6 commit ed13438
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Conduit/Conduit.Web/Articles/Controllers/CommentsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public async Task<IActionResult> AddComment([FromRoute] string slug, [FromBody]
/// </remarks>
/// <param name="slug">Article slug (required)</param>
/// <returns>Comments array</returns>
/// <response code="200">Successfully retrieved comments</response>
/// <response code="404">Article wasn't found</response>
/// <response code="500">Something went wrong while deleting the comment</response>
[HttpGet]
[AllowAnonymous]
[Route("/api/articles/{slug}/comments")]
Expand Down Expand Up @@ -107,6 +110,16 @@ public async Task<IActionResult> GetComments([FromRoute] string slug)
return Ok(new { comments = response.CommentsView });
}

/// <summary>
/// Delete a comment from an article
/// </summary>
/// <param name="slug">Article slug (required)</param>
/// <param name="commentId">Comment ID (required)</param>
/// <response code="200">Successfully deleted</response>
/// <response code="401">Unauthorized, likely because credentials are incorrect or its not your comment</response>
/// <response code="404">Article or comment wasn't found</response>
/// <response code="422">Comment couldn't be deleted</response>
/// <response code="500">Something went wrong while deleting the comment</response>
[HttpDelete]
[Route("/api/articles/{slug}/comments/{commentId}")]
[Authorize]
Expand Down

0 comments on commit ed13438

Please sign in to comment.