fix => services for fetchSlaughterBroadcastAndProducts

This commit is contained in:
2026-01-28 14:43:26 +03:30
parent 6ad291867e
commit fa3543f43e
19 changed files with 317 additions and 54 deletions

View File

@@ -8,7 +8,7 @@ import {
ListItemIcon,
} from "@mui/material";
import { useState } from "react";
import { useDispatch } from "react-redux";
import { useDispatch, useSelector } from "react-redux";
import { DRAWER, OPEN_MODAL } from "../../../../lib/redux/slices/appSlice";
import { slaughterDeleteInventoryFreeBarService } from "../../services/slaughter-delete-inventory-free-bar";
import { SlaughterSubmitFreeBar } from "../slaughter-submit-free-bar/SlaughterSubmitFreeBar";
@@ -26,7 +26,9 @@ export const SlaughterFreeBarsOperations = ({
type,
}) => {
const dispatch = useDispatch();
const selectedSubUser = useSelector(
(state) => state.userSlice.selectedSubUser
);
const [anchorEl, setAnchorEl] = useState(null);
const handleClick = (event) => {
@@ -158,7 +160,11 @@ export const SlaughterFreeBarsOperations = ({
slaughterDeleteInventoryFreeBarService(item.key)
).then(() => {
updateTable();
dispatch(fetchSlaughterBroadcastAndProducts());
dispatch(
fetchSlaughterBroadcastAndProducts({
role_key: selectedSubUser?.key || "",
})
);
});
}}
>