From ab3816ad1bbcf23bedce27803a4859a06241576b Mon Sep 17 00:00:00 2001 From: yumzen Date: Tue, 24 Sep 2024 01:07:39 +0900 Subject: [PATCH] =?UTF-8?q?[#238]=20fix:=20passCount=20=EB=A1=9C=EC=A7=81?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gongjakso/server/domain/team/service/TeamService.java | 7 +++++++ 1 file changed, 7 insertions(+) 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); + } }