Commit b74f6ee7 authored by Muhammad Ameen's avatar Muhammad Ameen 💻

add

parent 13f4b693
...@@ -21,8 +21,6 @@ const Home = () => { ...@@ -21,8 +21,6 @@ const Home = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
console.log(cart)
const openNotification = (item, behaviour) => { const openNotification = (item, behaviour) => {
if (behaviour === "success") { if (behaviour === "success") {
console.log(item); console.log(item);
......
...@@ -70,6 +70,10 @@ export const cartSlice = createSlice({ ...@@ -70,6 +70,10 @@ export const cartSlice = createSlice({
state.total = state.total =
state.total - state.total -
action.payload?.item?.data?.price * action.payload?.item?.counting; action.payload?.item?.data?.price * action.payload?.item?.counting;
action.payload.openNotification(
"Item Remove From Cart Sucessfully",
"success"
);
}, },
increaseQuantity(state, action) { increaseQuantity(state, action) {
state.cart[action.payload?.data?.id].counting++; state.cart[action.payload?.data?.id].counting++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment