We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c5df63f + 3edaee9 commit a7c30cbCopy full SHA for a7c30cb
store/useCart.js
@@ -27,13 +27,12 @@ export const useCart = defineStore("cartState", {
27
const response = await mutate({
28
input: {
29
productId: product.databaseId,
30
- quantity: 1, // Assuming you're adding one product at a time
+ quantity: 1,
31
},
32
});
33
34
if (response.data && response.data.addToCart) {
35
this.loading = false;
36
- // Assuming the response returns the updated cart item, we need to handle it properly
37
const newCartItem = response.data.addToCart.cartItem;
38
const foundProductInCartIndex = this.cart.findIndex(
39
(cartProduct) => newCartItem.product.node.slug === cartProduct.slug
0 commit comments