Skip to content

Commit

Permalink
fix: quantity 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeongh00 committed Aug 5, 2024
1 parent b231621 commit a616047
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public OrderDetail findMyOrderDetail(String accessToken, Long orderId) {
List<OrderItem> items = orderQueryService.findOrderItemByOrderId(orderId);
Menu menu = menuQueryService.findMenuById(items.get(0).getMenu().getId());
Store store = storeQueryService.findStoreById(menu.getStore().getId());
// Market market = marketQueryService.findMarket(store.getMarket().getId());

List<MenuOrder> menuOrders = new ArrayList<>();
boolean reviewYn = reviewQueryService.findReviewByOrderAndUser(order.getId(), user.getUserId()) != null;
Expand All @@ -113,7 +112,7 @@ public OrderDetail findMyOrderDetail(String accessToken, Long orderId) {
singleMenu.getName(),
singleMenu.getImageUrl(),
o.getQuantity(),
singleMenu.getPrice()
singleMenu.getPrice() * o.getQuantity()
);
menuOrders.add(menuOrder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ public void approval(String accessToken, ApprovalRequest request) {

Long m = value.getId();
Menu menu = menuQueryService.findMenuById(m);
int quantity = request.amount() / menu.getPrice();

final OrderItem orderItem = OrderItem.builder().order(order).menu(menu).quantity(request.amount()).build();
final OrderItem orderItem = OrderItem.builder().order(order).menu(menu).quantity(quantity).build();
orderQueryService.saveOrderItem(orderItem);
}
}
Expand Down

0 comments on commit a616047

Please sign in to comment.