fixe notification
This commit is contained in:
@@ -87,7 +87,7 @@ const CreateFormContent = ({ setOpen, mutate, rowId }) => {
|
||||
const [itemsList, setItemsList] = useState();
|
||||
const [subItemsList, setSubItemsList] = useState([]);
|
||||
const theme = useTheme();
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
|
||||
@@ -12,7 +12,7 @@ const PrintExcel = ({ table, filterData }) => {
|
||||
const theme = useTheme();
|
||||
const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
|
||||
const [loading, setLoading] = useState(false);
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const activeFilters = Object.entries(filterData).reduce((acc, [key, filter]) => {
|
||||
if (filter.value) {
|
||||
// Check if there's an active filter
|
||||
@@ -39,7 +39,7 @@ const PrintExcel = ({ table, filterData }) => {
|
||||
const filename = `خروجی کارتابل فعالیت روزانه تاریخ_${moment().format("jYYYY_jMM_jDD")}.xlsx`;
|
||||
FileSaver.saveAs(response.data, filename);
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => { })
|
||||
.finally(() => {
|
||||
setLoading(false);
|
||||
});
|
||||
|
||||
@@ -97,14 +97,14 @@ const EditFormContent = ({ row, mutate, setOpenEditDialog, rowId, subItem }) =>
|
||||
subItem.needs_end_point === 1 && formData.append("end_point", endPoint);
|
||||
|
||||
requestServer(`${UPDATE_ROAD_ITEMS}/${rowId}`, "post", {
|
||||
notification: { success: true },
|
||||
notificationSuccess: true,
|
||||
data: formData,
|
||||
})
|
||||
.then((res) => {
|
||||
mutate();
|
||||
setOpenEditDialog(false);
|
||||
})
|
||||
.catch((err) => {});
|
||||
.catch((err) => { });
|
||||
};
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -4,7 +4,7 @@ import useRequest from "@/lib/hooks/useRequest";
|
||||
import { VERIFY_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
|
||||
const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const {
|
||||
register,
|
||||
@@ -28,7 +28,7 @@ const ConfirmContent = ({ rowId, mutate, setOpenConfirmDialog }) => {
|
||||
mutate();
|
||||
setOpenConfirmDialog(false);
|
||||
})
|
||||
.catch(() => {});
|
||||
.catch(() => { });
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ import { DELETE_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
|
||||
const DeleteContent = ({ rowId, mutate, setOpenDeleteDialog }) => {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const handleClick = () => {
|
||||
setSubmitting(true);
|
||||
requestServer(`${DELETE_BY_SUPERVISOR}/${rowId}`, "post")
|
||||
|
||||
@@ -6,7 +6,7 @@ import useRequest from "@/lib/hooks/useRequest";
|
||||
import { REJECT_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
|
||||
const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
|
||||
const validationSchema = Yup.object().shape({
|
||||
description: Yup.string().required("توضیحات الزامیست!!!"),
|
||||
@@ -36,7 +36,7 @@ const RejectContent = ({ rowId, mutate, setOpenRejectDialog }) => {
|
||||
mutate();
|
||||
setOpenRejectDialog(false);
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => { })
|
||||
.finally(() => {
|
||||
reset();
|
||||
});
|
||||
|
||||
@@ -5,7 +5,7 @@ import { RESTORE_BY_SUPERVISOR } from "@/core/utils/routes";
|
||||
|
||||
const RestoreContent = ({ rowId, mutate, setOpenRestoreDialog }) => {
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const requestServer = useRequest({ notification: { success: true } });
|
||||
const requestServer = useRequest({ notificationSuccess: true });
|
||||
const handleClick = () => {
|
||||
setSubmitting(true);
|
||||
requestServer(`${RESTORE_BY_SUPERVISOR}/${rowId}`, "post")
|
||||
|
||||
Reference in New Issue
Block a user