Skip to content

Commit

Permalink
Merge pull request #57 from GApple-T/consulting
Browse files Browse the repository at this point in the history
상담 신청할 때 모든 학생을 대상으로 시간을 검색하던 문제를 수정
  • Loading branch information
enbraining authored Dec 26, 2023
2 parents ac1ea8e + 4d9d27e commit f8a37de
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public ResponseEntity<ConsultingSubmitResponse> submitConsulting(ConsultingSubmi
request.getTime(),
request.getDescription());

if(consultingRepository.existsByTime(consulting.getTime())){
throw new SameConsultingException();
}
member.getConsulting().forEach(c -> {
if(request.getTime() == c.getTime()){
throw new SameConsultingException();
}
});

member.addConsulting(consulting);

Expand Down

0 comments on commit f8a37de

Please sign in to comment.