Skip to content

Commit

Permalink
HOTIFX: 댓글 수 계산 오류 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
hyxklee committed Aug 21, 2024
1 parent d5615b0 commit 71291dd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.Entity;
import jakarta.persistence.OneToMany;
import jakarta.persistence.PreUpdate;
import leets.weeth.domain.board.application.dto.NoticeDTO;
import leets.weeth.domain.comment.domain.entity.Comment;
import lombok.AccessLevel;
Expand All @@ -23,7 +22,6 @@ public class Notice extends Board {
@JsonManagedReference
private List<Comment> comments;

@PreUpdate
public void updateCommentCount() {
this.updateCommentCount(this.comments);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.Entity;
import jakarta.persistence.OneToMany;
import jakarta.persistence.PreUpdate;
import leets.weeth.domain.board.application.dto.PostDTO;
import leets.weeth.domain.comment.domain.entity.Comment;
import lombok.AccessLevel;
Expand All @@ -23,7 +22,6 @@ public class Post extends Board {
@JsonManagedReference
private List<Comment> comments;

@PreUpdate
public void updateCommentCount() {
this.updateCommentCount(this.comments);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void saveNoticeComment(CommentDTO.Save dto, Long noticeId, Long userId) {
// 부모 댓글이 있다면 자녀 댓글로 추가
parentComment.addChild(comment);
}
notice.increaseCommentCount();
notice.updateCommentCount();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void savePostComment(CommentDTO.Save dto, Long postId, Long userId) {
// 부모 댓글이 있다면 자녀 댓글로 추가
parentComment.addChild(comment);
}
post.increaseCommentCount();
post.updateCommentCount();
}

@Override
Expand Down

0 comments on commit 71291dd

Please sign in to comment.