Skip to content

Commit

Permalink
Fix: 일기 시간조회 오류 수정 (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyukjinKimm authored Jul 18, 2024
1 parent cdc3815 commit 6b376af
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,12 @@ public DiaryCreatedTimeGetResponse getDiaryCreatedTime(int year, int month, int
User user = userService.getUserById(JwtUtil.getLoginMemberId());
LocalDateTime start = LocalDateTime.of(year, month, date, 0, 0);
LocalDateTime end = start.plusDays(1);
List<Diary> findDiaries = diaryRetriever.getDiariesByUserAndDateBetween(user, start, end);
LocalDateTime createdTime = findDiaries.getFirst().getCreatedAt();
List<Diary> diaries = diaryRetriever.getDiariesByUserAndDateBetween(user, start, end);
List<Diary> filteredDiaries = diaries.stream()
.filter(diary -> !diary.isDeleted())
.toList();

LocalDateTime createdTime = filteredDiaries.getFirst().getCreatedAt();
return DiaryCreatedTimeGetResponse.of(createdTime.getHour(), createdTime.getMinute(),
createdTime.getSecond());
}
Expand Down

0 comments on commit 6b376af

Please sign in to comment.