Skip to content

Commit

Permalink
fix: 챌린지 상세 조회 - myChallengeStatus 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
daeunkwak committed Aug 26, 2023
1 parent 5f4ae37 commit 5244724
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ private String getChallengeStatus(Challenge challenge) {
else if(challenge.getChallengeStatus().equals(ChallengeStatus.POSSIBLE) || challenge.getChallengeStatus().equals(ChallengeStatus.RECRUITING)){
return "이 챌린지 참여하기";
}
// TODO : 점검
else if(challenge.getRecruitEndDate().isAfter(LocalDate.now()) && challenge.getParticipates().size() >= challenge.getChallengeCapacity()){
return "챌린지 모집 마감";
}
else if(challenge.getChallengeStatus().equals(ChallengeStatus.IMPOSSIBLE)
&& challenge.getRecruitStartDate().isBefore(LocalDate.now())){
return "챌린지 진행중";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public Participate create(Long challengeId, Long memberId) {
throw new CiderException("모집 기간이 마감된 챌린지입니다.");
}

if(challenge.getParticipates() != null){
if(!challenge.getParticipates().isEmpty()){
if(challenge.getParticipates().size() >= challenge.getChallengeCapacity()){
throw new CiderException("모집 인원이 마감된 챌린지입니다.");
}
Expand Down

0 comments on commit 5244724

Please sign in to comment.