Skip to content

Commit

Permalink
[FIX] recruit가 마감된 recruit인지 확인 후 apply
Browse files Browse the repository at this point in the history
  • Loading branch information
wken5577 committed Apr 15, 2024
1 parent 299df41 commit 73cc094
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package gg.recruit.api.user.service;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -93,6 +94,11 @@ public Long recruitApply(RecruitApplyParam param) {
user.updateTypes(user.getRacketType(), SnsType.BOTH);
}
Recruitment recruitments = recruitmentRepository.getById(param.getRecruitId());
// recruit가 종료되었는지 확인
if (recruitments.getEndTime().isBefore(LocalDateTime.now())) {
throw new ForbiddenException("마감된 공고입니다.");
}

Application newApplication = applicationRepository.save(new Application(user, recruitments));
for (RecruitApplyFormParam form :
param.getForms()) {
Expand Down

0 comments on commit 73cc094

Please sign in to comment.