diff --git a/components/dashboard/userAccount/detailUser/index.js b/components/dashboard/userAccount/detailUser/index.js index 99468eb..069dee1 100644 --- a/components/dashboard/userAccount/detailUser/index.js +++ b/components/dashboard/userAccount/detailUser/index.js @@ -13,6 +13,7 @@ import FamilyHistory from "./familyHistory"; import Relatives from "./relatives"; import { removeAdditionalKeysDashboard } from "@/helper"; import Cookies from "js-cookie"; +import { toast } from "react-toastify"; import LoadingComponent from "@/app/component/LoadingComponent"; function DetailUser({ user, isTurnsDetails, setIsTurnsDetails }) { @@ -43,6 +44,7 @@ function DetailUser({ user, isTurnsDetails, setIsTurnsDetails }) { ) .then(() => { setLoading(false); + toast.success("اطلاعات با موفقیت ثبت شد"); }) .catch(() => { setLoading(false); diff --git a/components/dashboard/userAccount/detailUser/information/ButtonSendData.js b/components/dashboard/userAccount/detailUser/information/ButtonSendData.js index cebd7d1..77f1f0d 100644 --- a/components/dashboard/userAccount/detailUser/information/ButtonSendData.js +++ b/components/dashboard/userAccount/detailUser/information/ButtonSendData.js @@ -5,8 +5,9 @@ import { removeAdditionalKeysDashboard, } from "@/helper"; import { request } from "@/services/response"; -import { Button } from "@mui/material"; +import { Button, CircularProgress } from "@mui/material"; import Cookies from "js-cookie"; +import { toast } from "react-toastify"; function ButtonSendData({ loading, @@ -51,6 +52,7 @@ function ButtonSendData({ uuid: response.uuid, }); setLoading(false); + toast.success("اطلاعات با موفقیت ثبت شد"); }) .catch(() => { setLoading(false); @@ -73,6 +75,7 @@ function ButtonSendData({ ) .then(() => { setLoading(false); + toast.success("اطلاعات با موفقیت ثبت شد"); }) .catch((err) => handleErrReq(err)); }; @@ -96,8 +99,14 @@ function ButtonSendData({ !mt-[32px] sm:!mt-[38px] md:!mt-[43px] lg:!mt-[48px] !px-[16px] sm:!px-[19px] md:!px-[22px] lg:!px-[24px] `} > - ثبت اطلاعات - + {loading ? ( + + ) : ( + <> + ثبت اطلاعات + + + )} ); }