Skip to content

Commit

Permalink
Hotfix : 댓글 삭제 시 게시물의 댓글 수 차감 로직 수정 (#151)
Browse files Browse the repository at this point in the history
* 🐛 Hotfix: 댓글 수정 request dto 추가

* 🐛 Hotfix: 댓글 삭제 시 게시물의 댓글 수 차감 로직 수정
  • Loading branch information
joowojr authored May 19, 2024
1 parent 2d914f1 commit 92f9a4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ public ApiResponse<CommentResponse.CommentProc> updateComment(@RequestBody Comme
@DeleteMapping("/{commentId}")
public ApiResponse<CommentResponse.CommentProc> deleteComment(
@PathVariable(name = "commentId") Long commentId) {

return ApiResponse.onSuccess(commentCommandService.delete(commentId));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ public CommentResponse.CommentProc update(String content, Long commentId) {

public CommentResponse.CommentProc delete(Long commentId) {
Comment comment = commentQueryService.findById(commentId);
comment.getBoard().changeComment(false);
Board board = comment.getBoard();
board.changeComment(false);
commentRepository.deleteById(commentId);
return CommentResponse.toCommentProc(commentId);
}
Expand Down

0 comments on commit 92f9a4e

Please sign in to comment.