Skip to content

Commit a7c30cb

Browse files
authored
Merge pull request #1296 from w3bdesign/dev
Update useCart.js
2 parents c5df63f + 3edaee9 commit a7c30cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

store/useCart.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,12 @@ export const useCart = defineStore("cartState", {
2727
const response = await mutate({
2828
input: {
2929
productId: product.databaseId,
30-
quantity: 1, // Assuming you're adding one product at a time
30+
quantity: 1,
3131
},
3232
});
3333

3434
if (response.data && response.data.addToCart) {
3535
this.loading = false;
36-
// Assuming the response returns the updated cart item, we need to handle it properly
3736
const newCartItem = response.data.addToCart.cartItem;
3837
const foundProductInCartIndex = this.cart.findIndex(
3938
(cartProduct) => newCartItem.product.node.slug === cartProduct.slug

0 commit comments

Comments
 (0)