Skip to content

Commit

Permalink
Fix: 공모전에 해당하는 팀 조회 시 예외처리 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yumzen committed Sep 21, 2024
1 parent a65bc83 commit c37d209
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public TeamRes getTeam(Long contestId, Long teamId) {
.orElseThrow(() -> new ApplicationException(ErrorCode.CONTEST_NOT_FOUND_EXCEPTION));
Team team = teamRepository.findByIdAndDeletedAtIsNull(teamId)
.orElseThrow(() -> new ApplicationException(ErrorCode.TEAM_NOT_FOUND_EXCEPTION));
if(!team.getContest().getId().equals(contestId)) {
throw new ApplicationException(ErrorCode.TEAM_NOT_FOUND_EXCEPTION);
}

// Business Logic
return TeamRes.of(team);
Expand Down

0 comments on commit c37d209

Please sign in to comment.