Skip to content

Commit

Permalink
Fix: updateDeletedDiary에서 created_at null값 입력 수정/ getTodayDiaiesByUse…
Browse files Browse the repository at this point in the history
…r 조회 안되는 오류 수정
  • Loading branch information
hyukjinKimm committed Aug 23, 2024
1 parent 671e0b9 commit 216a888
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public void updateDeletedDiary(User user, DiaryRequest request) {
.content(content)
.user(user)
.updatedAt(LocalDateTime.now())
.createdAt(LocalDateTime.now())
.build())
.collect(Collectors.toUnmodifiableList());
diaryRepository.saveAll(newDiaries);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ public class DiaryRetriever {
private final DiaryRepository diaryRepository;

public List<Diary> getTodayDiariesByUser(User user, LocalDateTime currentTime) {
LocalDateTime start = LocalDateTime.of(LocalDate.now(), LocalTime.MIDNIGHT);
LocalDateTime end = currentTime;
LocalDateTime start = LocalDateTime.of(currentTime.getYear(), currentTime.getMonth(), currentTime.getDayOfMonth(), 0, 0);
LocalDateTime end = start.plusDays(1);
return diaryRepository.findDiariesByUserAndCreatedAtBetween(user, start, end);
}

Expand Down

0 comments on commit 216a888

Please sign in to comment.