diff --git a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java index 3334fab..768d539 100644 --- a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java +++ b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java @@ -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()){ @@ -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); + } }