diff --git a/components/Cart/CartContents.vue b/components/Cart/CartContents.vue index 0150d7c5..2d6888a7 100644 --- a/components/Cart/CartContents.vue +++ b/components/Cart/CartContents.vue @@ -57,18 +57,13 @@ const cartItems = computed(() => cart.cart); const handleRemoveProduct = async (key) => { try { await cart.removeProductFromCart(key); - } catch (error) { - console.error("Error removing product from cart:", error); - // Optionally, you can add a user-friendly notification here - // without exposing the error details - } + } catch (error) {} }; onMounted(async () => { try { await cart.refetch(); } catch (err) { - console.error("Error fetching cart:", err); error.value = err; } finally { isLoading.value = false; @@ -84,7 +79,6 @@ const handleUpdateQuantity = async ({ key, quantity }) => { try { await cart.updateCartItemQuantity(key, quantity); } catch (error) { - console.error("Error updating cart item quantity:", error); // Optionally, add user notification here } }; diff --git a/components/Products/ProductsSingleProduct.vue b/components/Products/ProductsSingleProduct.vue index bb1e13a6..8dcf9c0e 100644 --- a/components/Products/ProductsSingleProduct.vue +++ b/components/Products/ProductsSingleProduct.vue @@ -127,8 +127,7 @@ const addProductToCart = async (product) => { await cart.addToCart(product); toast.value.show(); } catch (error) { - console.error("Error adding product to cart:", error); - // You might want to show an error message to the user here + } }; diff --git a/store/useCart.js b/store/useCart.js index 87c58ce7..b386e6b0 100644 --- a/store/useCart.js +++ b/store/useCart.js @@ -1,6 +1,7 @@ import { defineStore } from "pinia"; import { useQuery, useMutation } from "@vue/apollo-composable"; import { computed, ref, watch } from "vue"; + import ADD_TO_CART_MUTATION from "@/apollo/mutations/ADD_TO_CART_MUTATION.gql"; import UPDATE_CART_MUTATION from "@/apollo/mutations/UPDATE_CART_MUTATION.gql"; import GET_CART_QUERY from "@/apollo/queries/GET_CART_QUERY.gql"; @@ -61,7 +62,6 @@ export const useCart = defineStore("cartState", () => { }); await refetchCart(); } catch (err) { - console.error("Error adding to cart:", err); } finally { loading.value = false; } @@ -79,7 +79,6 @@ export const useCart = defineStore("cartState", () => { }); await refetchCart(); } catch (err) { - console.error("Error updating cart:", err); await refetchCart(); } finally { loading.value = false; @@ -92,7 +91,6 @@ export const useCart = defineStore("cartState", () => { try { await updateCartItemQuantity(key, 0); } catch (err) { - console.error("Error removing product from cart:", err); } finally { loading.value = false; await refetchCart(); @@ -107,7 +105,6 @@ export const useCart = defineStore("cartState", () => { await removeProductFromCart(item.key); } } catch (err) { - console.error("Error clearing cart:", err); } finally { loading.value = false; await refetchCart();