Skip to content

Commit

Permalink
Update CommentController.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
EdiWang committed Apr 29, 2024
1 parent c84127f commit d9cc578
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Moonglade.Web/Controllers/CommentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class CommentController(
[HttpPost("{postId:guid}")]
[AllowAnonymous]
[ServiceFilter(typeof(ValidateCaptcha))]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
[ProducesResponseType(StatusCodes.Status403Forbidden)]
Expand Down Expand Up @@ -78,6 +79,11 @@ public async Task<IActionResult> Create([NotEmpty] Guid postId, CommentRequest r
}
}

if (blogConfig.ContentSettings.RequireCommentReview)
{
return Created("moonglade://empty", item);
}

return NoContent();
}

Expand Down

0 comments on commit d9cc578

Please sign in to comment.