From 4d92e076fd899eabd7bb9214433203f4d65dadd7 Mon Sep 17 00:00:00 2001 From: kang Date: Thu, 26 Sep 2024 12:15:13 +0900 Subject: [PATCH] feat: update query --- src/main/java/co/orange/ddanzi/service/ItemService.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/main/java/co/orange/ddanzi/service/ItemService.java b/src/main/java/co/orange/ddanzi/service/ItemService.java index f502e53..16041ce 100644 --- a/src/main/java/co/orange/ddanzi/service/ItemService.java +++ b/src/main/java/co/orange/ddanzi/service/ItemService.java @@ -106,7 +106,7 @@ public ApiResponse getItem(String itemId){ return ApiResponse.onFailure(Error.ITEM_UNAUTHORIZED_USER, null); //get latest order - Order order = orderRepository.findLatestOrderByItem(item).orElse(null); + Order order = orderRepository.findByItemAnAndStatus(item).orElse(null); Payment payment = null; if(order!=null) @@ -185,10 +185,6 @@ private List setSelectedOptionList(Order order){ return selectedOptionList; } - public Integer getMyItemCount(User user){ - return itemRepository.countAllBySeller(user); - } - public List getMyItemList(User user){ List itemList = itemRepository.findAllBySeller(user); List myItemList = new ArrayList<>();