From 69ca94c77b62c1cb669fc18d8af098afdac1e06c Mon Sep 17 00:00:00 2001 From: Thastertyn Date: Wed, 13 Mar 2024 21:41:45 +0100 Subject: [PATCH] Used correct HTTP error --- app/services/cart_service.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/services/cart_service.py b/app/services/cart_service.py index 071c174..d6c81ce 100644 --- a/app/services/cart_service.py +++ b/app/services/cart_service.py @@ -62,7 +62,7 @@ class CartService: return {"Success": "Successfully added to cart"}, 200 except Error as e: - return {"Failed": f"Failed to update item count in cart. Reason: {e}"}, 400 + return {"Failed": f"Failed to update item count in cart. Reason: {e}"}, 500 @staticmethod def delete_from_cart(user_id: str, product_id: int) -> Tuple[Union[dict, str], int]: @@ -85,7 +85,7 @@ class CartService: return {"Success": "Successfully removed item from cart"}, 200 except Error as e: - return {"Failed": f"Failed to remove item from cart. Reason: {e}"}, 400 + return {"Failed": f"Failed to remove item from cart. Reason: {e}"}, 500 @staticmethod @@ -119,7 +119,7 @@ class CartService: return results, 200 except Error as e: - return {"Failed": f"Failed to load cart. Reason: {e}"}, 400 + return {"Failed": f"Failed to load cart. Reason: {e}"}, 500 @staticmethod @@ -176,7 +176,7 @@ class CartService: # clear cart except Error as e: - return {"Failed": f"Failed to load cart. Reason: {e}"}, 400 + return {"Failed": f"Failed to load cart. Reason: {e}"}, 500 return {"Success": "Successfully purchased"}, 200