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 cd32b32
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class Contest extends BaseTimeEntity {
@Column(name = "img_url",columnDefinition = "text")
private String imgUrl;
@Column(name = "view", nullable = false, columnDefinition = "bigint")
private Integer view;
private int view;

public void update(UpdateContestDto contest,String imgUrl){
this.title= (contest.title()==null) ? this.title : contest.title();
Expand Down
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 cd32b32

Please sign in to comment.