feat(dashboard): loading spinner and success toast on profile save
The ثبت اطلاعات button gave no feedback. Show a spinner while saving (both POST and PATCH) and a 'اطلاعات با موفقیت ثبت شد' toast on success, for the info tab and the medical-history sub-tabs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user