Used correct HTTP error
This commit is contained in:
parent
b1fb6ee099
commit
69ca94c77b
@ -62,7 +62,7 @@ class CartService:
|
|||||||
return {"Success": "Successfully added to cart"}, 200
|
return {"Success": "Successfully added to cart"}, 200
|
||||||
|
|
||||||
except Error as e:
|
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
|
@staticmethod
|
||||||
def delete_from_cart(user_id: str, product_id: int) -> Tuple[Union[dict, str], int]:
|
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
|
return {"Success": "Successfully removed item from cart"}, 200
|
||||||
except Error as e:
|
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
|
@staticmethod
|
||||||
@ -119,7 +119,7 @@ class CartService:
|
|||||||
return results, 200
|
return results, 200
|
||||||
|
|
||||||
except Error as e:
|
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
|
@staticmethod
|
||||||
@ -176,7 +176,7 @@ class CartService:
|
|||||||
|
|
||||||
# clear cart
|
# clear cart
|
||||||
except Error as e:
|
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
|
return {"Success": "Successfully purchased"}, 200
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user