fixe notification

This commit is contained in:
Amirhossein Mahmoodi
2024-12-23 12:19:32 +03:30
parent 3004133d3b
commit a6eef76045
13 changed files with 24 additions and 26 deletions

View File

@@ -40,7 +40,7 @@ const RoadSafetyFormContext = ({ rowId, mutate, setOpenRoadSafetyForm }) => {
const defaultValues = {
description: "",
};
const requestServer = useRequest({ notification: { success: true, show: true } });
const requestServer = useRequest({ notificationSuccess: true });
const { message, loadingMessage, errorMessage } = usePrevStateOpinion();
const {
register,
@@ -57,7 +57,7 @@ const RoadSafetyFormContext = ({ rowId, mutate, setOpenRoadSafetyForm }) => {
setOpenRoadSafetyForm(false);
mutate();
})
.catch(() => {});
.catch(() => { });
};
return (
<StyledForm onSubmit={handleSubmit(onSubmit)}>

View File

@@ -31,7 +31,7 @@ const ReferFormContext = ({ setOpenReferDialog, rowId, mutate }) => {
city: "",
};
const { cities, loadingCities, errorCities } = useCities();
const requestServer = useRequest({ notification: { show: true, success: true } });
const requestServer = useRequest({ notificationSuccess: true });
const {
control,
register,
@@ -50,7 +50,7 @@ const ReferFormContext = ({ setOpenReferDialog, rowId, mutate }) => {
setOpenReferDialog(false);
mutate();
})
.catch(() => {});
.catch(() => { });
};
return (
<StyledForm onSubmit={handleSubmit(onSubmit)}>

View File

@@ -40,7 +40,7 @@ const RoadSafetyFormContext = ({ rowId, mutate, setOpenRoadSafetyForm }) => {
const defaultValues = {
description: "",
};
const requestServer = useRequest({ notification: { success: true, show: true } });
const requestServer = useRequest({ notificationSuccess: true });
const { message, loadingMessage, errorMessage } = usePrevStateOpinion();
const {
register,
@@ -57,7 +57,7 @@ const RoadSafetyFormContext = ({ rowId, mutate, setOpenRoadSafetyForm }) => {
setOpenRoadSafetyForm(false);
mutate();
})
.catch(() => {});
.catch(() => { });
};
return (
<StyledForm onSubmit={handleSubmit(onSubmit)}>

View File

@@ -31,7 +31,7 @@ const ReferFormContext = ({ setOpenReferDialog, rowId, mutate }) => {
province: "",
};
const { provinces, loadingProvinces, errorProvinces } = useProvinces();
const requestServer = useRequest({ notification: { show: true, success: true } });
const requestServer = useRequest({ notificationSuccess: true });
const {
control,
register,

View File

@@ -41,7 +41,7 @@ const RoadSafetyFormContext = ({ rowId, mutate, setOpenRoadSafetyForm }) => {
description: "",
RadioGroup: "",
};
const requestServer = useRequest({ notification: { success: true, show: true } });
const requestServer = useRequest({ notificationSuccess: true });
const {
register,
handleSubmit,