Skip to content

Commit

Permalink
[BE] FIX: 취소된 날짜에 다시 신청 시 500 에러 수정
Browse files Browse the repository at this point in the history
presentationForm 가져오는 부분 List 형식으로 변경
  • Loading branch information
chyo1 committed Oct 29, 2024
1 parent 20fbe9c commit 892a204
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ List<Presentation> findAllByDateTimeBetweenOrderByDateTime(LocalDateTime start,

List<Presentation> findAllByDateTimeBetween(LocalDateTime start, LocalDateTime end);

Optional<Presentation> findPresentationByDateTimeBetween(LocalDateTime startOfDate,
List<Presentation> findPresentationByDateTimeBetween(LocalDateTime startOfDate,
LocalDateTime endOfDate);

@EntityGraph(attributePaths = "user")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@ public List<Presentation> getPresentationsByYearMonth(YearMonth yearMonth) {
public Presentation getPresentationsByDate(LocalDateTime dateTime) {
LocalDateTime startOfDate = dateTime.withHour(0).withMinute(0).withSecond(0);
LocalDateTime endOfDate = dateTime.withHour(23).withMinute(59).withSecond(59);
return presentationRepository.findPresentationByDateTimeBetween(startOfDate,
endOfDate)
return presentationRepository.findPresentationByDateTimeBetween(startOfDate, endOfDate)
.stream().filter(p -> p.getPresentationStatus() != PresentationStatus.CANCEL)
.findFirst()
.orElseThrow(ExceptionStatus.INVALID_PRESENTATION_DATE::asServiceException);
}

Expand Down

0 comments on commit 892a204

Please sign in to comment.