Skip to content

Remove console logs #1493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions components/Cart/CartContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}
};
Expand Down
3 changes: 1 addition & 2 deletions components/Products/ProductsSingleProduct.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
};
</script>
5 changes: 1 addition & 4 deletions store/useCart.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -61,7 +62,6 @@ export const useCart = defineStore("cartState", () => {
});
await refetchCart();
} catch (err) {
console.error("Error adding to cart:", err);
} finally {
loading.value = false;
}
Expand All @@ -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;
Expand All @@ -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();
Expand All @@ -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();
Expand Down