diff --git a/src/main/java/com/ivory/ivory/repository/ApplyRepository.java b/src/main/java/com/ivory/ivory/repository/ApplyRepository.java index 76f04d5..99f5145 100644 --- a/src/main/java/com/ivory/ivory/repository/ApplyRepository.java +++ b/src/main/java/com/ivory/ivory/repository/ApplyRepository.java @@ -10,7 +10,7 @@ @Repository public interface ApplyRepository extends JpaRepository { - List findAllByChild_Id(Long childId); + List findAllByChild_IdOrderByCreateAtDesc(Long childId); Optional findById (Long applyId); Apply findFirstByChild_IdOrderByCreateAt(Long childID); Optional findFirstByStatusOrderByCreateAtDesc(Status status); diff --git a/src/main/java/com/ivory/ivory/service/ApplyService.java b/src/main/java/com/ivory/ivory/service/ApplyService.java index 79375df..fca6cf9 100644 --- a/src/main/java/com/ivory/ivory/service/ApplyService.java +++ b/src/main/java/com/ivory/ivory/service/ApplyService.java @@ -121,7 +121,7 @@ public CustomApiResponse getApplyList(Long childId, Long currentMemberId) { throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "본인 자녀의 신청 내역만 조회할 수 있습니다."); } - List applyList = applyRepository.findAllByChild_Id(child.get().getId()); + List applyList = applyRepository.findAllByChild_IdOrderByCreateAtDesc(child.get().getId()); //응답 dto 생성 List applyListDto = new ArrayList<>();