Skip to content

Commit 7b6bc38

Browse files
authored
Merge pull request #1493 from w3bdesign/develop
Remove console logs
2 parents 0e54fa6 + 6e4b6cf commit 7b6bc38

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

components/Cart/CartContents.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,13 @@ const cartItems = computed(() => cart.cart);
5757
const handleRemoveProduct = async (key) => {
5858
try {
5959
await cart.removeProductFromCart(key);
60-
} catch (error) {
61-
console.error("Error removing product from cart:", error);
62-
// Optionally, you can add a user-friendly notification here
63-
// without exposing the error details
64-
}
60+
} catch (error) {}
6561
};
6662
6763
onMounted(async () => {
6864
try {
6965
await cart.refetch();
7066
} catch (err) {
71-
console.error("Error fetching cart:", err);
7267
error.value = err;
7368
} finally {
7469
isLoading.value = false;
@@ -84,7 +79,6 @@ const handleUpdateQuantity = async ({ key, quantity }) => {
8479
try {
8580
await cart.updateCartItemQuantity(key, quantity);
8681
} catch (error) {
87-
console.error("Error updating cart item quantity:", error);
8882
// Optionally, add user notification here
8983
}
9084
};

components/Products/ProductsSingleProduct.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ const addProductToCart = async (product) => {
127127
await cart.addToCart(product);
128128
toast.value.show();
129129
} catch (error) {
130-
console.error("Error adding product to cart:", error);
131-
// You might want to show an error message to the user here
130+
132131
}
133132
};
134133
</script>

store/useCart.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { defineStore } from "pinia";
22
import { useQuery, useMutation } from "@vue/apollo-composable";
33
import { computed, ref, watch } from "vue";
4+
45
import ADD_TO_CART_MUTATION from "@/apollo/mutations/ADD_TO_CART_MUTATION.gql";
56
import UPDATE_CART_MUTATION from "@/apollo/mutations/UPDATE_CART_MUTATION.gql";
67
import GET_CART_QUERY from "@/apollo/queries/GET_CART_QUERY.gql";
@@ -61,7 +62,6 @@ export const useCart = defineStore("cartState", () => {
6162
});
6263
await refetchCart();
6364
} catch (err) {
64-
console.error("Error adding to cart:", err);
6565
} finally {
6666
loading.value = false;
6767
}
@@ -79,7 +79,6 @@ export const useCart = defineStore("cartState", () => {
7979
});
8080
await refetchCart();
8181
} catch (err) {
82-
console.error("Error updating cart:", err);
8382
await refetchCart();
8483
} finally {
8584
loading.value = false;
@@ -92,7 +91,6 @@ export const useCart = defineStore("cartState", () => {
9291
try {
9392
await updateCartItemQuantity(key, 0);
9493
} catch (err) {
95-
console.error("Error removing product from cart:", err);
9694
} finally {
9795
loading.value = false;
9896
await refetchCart();
@@ -107,7 +105,6 @@ export const useCart = defineStore("cartState", () => {
107105
await removeProductFromCart(item.key);
108106
}
109107
} catch (err) {
110-
console.error("Error clearing cart:", err);
111108
} finally {
112109
loading.value = false;
113110
await refetchCart();

0 commit comments

Comments
 (0)