Skip to content

Commit

Permalink
Merge pull request #312 from 6QuizOnTheBlock/social_count_fix
Browse files Browse the repository at this point in the history
fix: κ²Œμ‹œκΈ€, λŒ“κΈ€ λ°˜μ‘ Count μˆ˜μ •
  • Loading branch information
HABINOH authored May 13, 2024
2 parents dfa05ee + 4bb1fe2 commit 7a578c3
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,12 @@ public Long write(CommentRequest request) {
boolean isFirstComment = request.parentId() == 0L
&& !commentRepository.existsByPostAndMember(post, commentWriter);
if (isFirstComment) {
updateSocialCount(orgId, post.getAuthor(), commentWriter);
updateSocialCount(orgId, commentWriter, post.getAuthor());
Member member1 = post.getAuthor().getId() < commentWriter.getId() ?
post.getAuthor() : commentWriter;
Member member2 = post.getAuthor().getId() < commentWriter.getId() ?
commentWriter : post.getAuthor();

updateSocialCount(orgId, member1, member2);
}
//ν•΄λ‹Ή λŒ“κΈ€μ— λ°˜μ‘(λŒ€λŒ“κΈ€ μž‘μ„±)을 ν•˜μ˜€λŠ”μ§€ 확인
if (request.parentId() > 0L) {
Expand Down Expand Up @@ -199,8 +203,13 @@ private void checkAndUpdateFirstResponse(
!commentRepository.existsByParentIdAndMember(parentComment.getId(),
commentWriter))) {
long orgId = post.getOrganization().getId();
updateSocialCount(orgId, parentComment.getMember(), commentWriter);
updateSocialCount(orgId, commentWriter, parentComment.getMember());

Member member1 = post.getAuthor().getId() < commentWriter.getId() ?
post.getAuthor() : commentWriter;
Member member2 = post.getAuthor().getId() < commentWriter.getId() ?
commentWriter : post.getAuthor();

updateSocialCount(orgId, member1, member2);
}
}

Expand Down

0 comments on commit 7a578c3

Please sign in to comment.