From 062705f56b0d965ec83b28d2ed5b2d77cb41cc7a Mon Sep 17 00:00:00 2001 From: Chirag Sonar <96980290+chirag1718@users.noreply.github.com> Date: Mon, 12 Jun 2023 20:00:33 +0530 Subject: [PATCH] Update and rename productSlide.js to productSlice.js close #1 Issue: As mentioned the product quantity in the cart was not decreasing on decrementing. Fix: There was a typo issue in decreaseQty where variable `const qtyDec = ++qty` I've replaced it with `const qtyDec = --qty` --- frontend/src/redux/{productSlide.js => productSlice.js} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename frontend/src/redux/{productSlide.js => productSlice.js} (94%) diff --git a/frontend/src/redux/productSlide.js b/frontend/src/redux/productSlice.js similarity index 94% rename from frontend/src/redux/productSlide.js rename to frontend/src/redux/productSlice.js index 955bd13..22896f7 100644 --- a/frontend/src/redux/productSlide.js +++ b/frontend/src/redux/productSlice.js @@ -47,7 +47,7 @@ export const productSlice = createSlice({ const index = state.cartItem.findIndex((el) => el._id === action.payload); let qty = state.cartItem[index].qty; if (qty > 1) { - const qtyDec = ++qty; + const qtyDec = --qty; state.cartItem[index].qty = qtyDec; const price = state.cartItem[index].price;