Skip to content

Commit

Permalink
Update CartService.java
Browse files Browse the repository at this point in the history
  • Loading branch information
abidknashtech authored Dec 1, 2023
1 parent a36d386 commit 242b030
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public CartItem removeFromCart(String productId, int quantity, String userId) {
int updatedQuantity = cartItem.getQuantity() - quantity;
if (updatedQuantity <= 0) {
cartItemRepository.delete(cartItem);
throw new IllegalStateException("Product removed from cart");
// throw new IllegalStateException("Product removed from cart");
} else {
cartItem.setQuantity(updatedQuantity);
cartItem = cartItemRepository.save(cartItem);
Expand Down

0 comments on commit 242b030

Please sign in to comment.