refactor: resolve issue fix
This commit is contained in:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user