refactor: resolve issue fix

This commit is contained in:
2025-05-14 19:21:59 +05:30
parent a8fecc5f3d
commit 668900661d
4 changed files with 7 additions and 5 deletions

View File

@@ -22,8 +22,13 @@ const ShoppingCart = () => {
const { formatPrice } = useCurrency();
const getCart = async () => {
const response = await authAxios.get("/orders/cart/");
setCartItems(response.data);
token = localStorage.getItem("token")
if (token == null) {
setCartItems([])
} else {
const response = await authAxios.get("/orders/cart/");
setCartItems(response.data);
}
};
useEffect(() => {