update
Build & Deploy (develop) / build-and-deploy (push) Successful in 1m44s

This commit is contained in:
2026-09-14 08:36:22 +03:30
parent c4d9351e91
commit fe86b58012
5 changed files with 102 additions and 68 deletions
+7
View File
@@ -22,6 +22,12 @@ const cartSlice = createSlice({
removeFromCart: (state, action) => {
state.items = state.items.filter((item) => item.id !== action.payload);
},
setQuantity: (state, action) => {
const { id, qty } = action.payload;
if (!Number.isSafeInteger(qty) || qty < 1) return;
const item = state.items.find((item) => item.id === id);
if (item) item.qty = qty;
},
incrementQty: (state, action) => {
const item = state.items.find((item) => item.id === action.payload);
if (item) item.qty += 1;
@@ -52,6 +58,7 @@ const cartSlice = createSlice({
export const {
addToCart,
removeFromCart,
setQuantity,
incrementQty,
decrementQty,
clearCart,