Skip to content

Commit

Permalink
Merge pull request #52 from Parkjyun/fix/51
Browse files Browse the repository at this point in the history
[fix] 토론 참여 삭제 시 토론의 투표수 감소시키도록 변경
  • Loading branch information
Parkjyun authored May 12, 2024
2 parents 73908ac + 4ca863d commit 2241da2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,12 @@ public void upVote() {
public void downVote() {
this.downVoteCount++;
}

public void decreaseVoteCount(boolean vote) {
if (vote) {
upVoteCount--;
} else {
downVoteCount--;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public void deleteDebateComment(Long debateParticipationId, Long memberId) {
if (!isMyDebateParticipation(debateParticipation, memberId)) {
throw new DebateParticipationException(DebateParticipationFailureCode.NOT_MY_DEBATE_PARTICIPATION);
}
debateParticipation.getDebate().decreaseVoteCount(debateParticipation.getVote());
debateParticipationJpaRepository.delete(debateParticipation);
}

Expand Down

0 comments on commit 2241da2

Please sign in to comment.