From 8a1bd93c10cd6713843b02804c67f18c2a1b9b38 Mon Sep 17 00:00:00 2001 From: JuyeonLee <104489022+Juye0nLee@users.noreply.github.com> Date: Sat, 7 Dec 2024 18:43:43 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=ED=95=99=EB=B6=80=EB=AA=A8ver?= =?UTF-8?q?=20=EC=8B=A0=EC=B2=AD=20=EB=AA=A9=EB=A1=9D=20=EC=B5=9C=EC=8B=A0?= =?UTF-8?q?=EC=88=9C=20=EC=A0=95=EB=A0=AC=20=EC=88=98=EC=A0=95=20(#61)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/ivory/ivory/repository/ApplyRepository.java | 2 +- src/main/java/com/ivory/ivory/service/ApplyService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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<>();