From 668900661d52f48b4aea59b566d79e65599c2ab0 Mon Sep 17 00:00:00 2001 From: Tariq Jamal A Date: Wed, 14 May 2025 19:21:59 +0530 Subject: [PATCH] refactor: resolve issue fix --- components/products/AddToCardRightSection.jsx | 1 - components/shopping-cart/shoppingCart.jsx | 9 +++++++-- components/siddha-mala/categoryHero.jsx | 1 - components/subcategory/SubcategoryHero.jsx | 1 - 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/products/AddToCardRightSection.jsx b/components/products/AddToCardRightSection.jsx index d0e3023..868e7bc 100644 --- a/components/products/AddToCardRightSection.jsx +++ b/components/products/AddToCardRightSection.jsx @@ -66,7 +66,6 @@ function ProductDetails({ productId }) { {formatPrice(totalPrice)} )} - INR ) : (
Price on request
diff --git a/components/shopping-cart/shoppingCart.jsx b/components/shopping-cart/shoppingCart.jsx index 3c31c30..000b554 100644 --- a/components/shopping-cart/shoppingCart.jsx +++ b/components/shopping-cart/shoppingCart.jsx @@ -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(() => { diff --git a/components/siddha-mala/categoryHero.jsx b/components/siddha-mala/categoryHero.jsx index 90ca947..b045a9c 100644 --- a/components/siddha-mala/categoryHero.jsx +++ b/components/siddha-mala/categoryHero.jsx @@ -38,7 +38,6 @@ const CategoryHero = ({ params }) => { objectFit="cover" quality={100} priority - className="brightness-75" /> diff --git a/components/subcategory/SubcategoryHero.jsx b/components/subcategory/SubcategoryHero.jsx index dbe07c2..f1e285f 100644 --- a/components/subcategory/SubcategoryHero.jsx +++ b/components/subcategory/SubcategoryHero.jsx @@ -50,7 +50,6 @@ const SubcategoryHero = ({ params }) => { objectFit="cover" quality={100} priority - className="brightness-75" />