diff --git a/src/main/java/com/ivory/ivory/repository/ApplyRepository.java b/src/main/java/com/ivory/ivory/repository/ApplyRepository.java index 99f5145..da366cc 100644 --- a/src/main/java/com/ivory/ivory/repository/ApplyRepository.java +++ b/src/main/java/com/ivory/ivory/repository/ApplyRepository.java @@ -12,7 +12,7 @@ public interface ApplyRepository extends JpaRepository { List findAllByChild_IdOrderByCreateAtDesc(Long childId); Optional findById (Long applyId); - Apply findFirstByChild_IdOrderByCreateAt(Long childID); + Apply findFirstByChild_IdOrderByCreateAtDesc(Long childID); Optional findFirstByStatusOrderByCreateAtDesc(Status status); List findAllByStatus(Status status); List findAllByOrderByCreateAtDesc(); diff --git a/src/main/java/com/ivory/ivory/service/ChildService.java b/src/main/java/com/ivory/ivory/service/ChildService.java index 3276677..4e46a13 100644 --- a/src/main/java/com/ivory/ivory/service/ChildService.java +++ b/src/main/java/com/ivory/ivory/service/ChildService.java @@ -87,7 +87,7 @@ public CustomApiResponse getChildren(Long memberId) { String recentApplyStatus = "아직 신청 내역이 없습니다"; //신청 상태 - Apply apply = applyRepository.findFirstByChild_IdOrderByCreateAt(child.getId()); + Apply apply = applyRepository.findFirstByChild_IdOrderByCreateAtDesc(child.getId()); if (apply != null) { recentApplyStatus = getStatus(apply.getStatus()); }