Skip to content

Commit

Permalink
[#238] fix: passCount 로직 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
yumzen committed Sep 23, 2024
1 parent 770fabf commit ab3816a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ public TeamRes getTeam(Member member, Long contestId, Long teamId, HttpServletRe

updateView(team, request, response);

updatePassCount(team);

if(member != null && team.getMember().getId().equals(member.getId())){
return TeamRes.of(team, "LEADER");
}else if(member != null && applyRepository.findByTeamIdAndMemberIdAndDeletedAtIsNull(teamId, member.getId()).isPresent()){
Expand Down Expand Up @@ -342,4 +344,9 @@ public void updateView(Team team, HttpServletRequest request, HttpServletRespons
response.addCookie(newCookie);
}
}

public void updatePassCount(Team team) {
int passCount = applyRepository.countByTeamIdAndStatusAndDeletedAtIsNull(team.getId(), ApplyStatus.ACCEPTED);
team.updatePassCount(passCount);
}
}

0 comments on commit ab3816a

Please sign in to comment.