added loader during submitting form data.

This commit is contained in:
Pramod Mahajan 2025-05-11 01:12:08 +05:30 committed by Vikas Nale
parent af6a6faa46
commit 292c920941

View File

@ -76,7 +76,9 @@ const EditActivityModal = ({
setValue("activityID", selectedId);
};
const onSubmitForm = async (data) => {
const onSubmitForm = async ( data ) =>
{
setIsSubmitting(true)
const updatedProject = { ...projects_Details };
const finalData = {
...data,
@ -142,13 +144,17 @@ const EditActivityModal = ({
});
resetForm();
dispatch( refreshData( true ) );
setIsSubmitting(false)
showToast("Activity Updated Successfully","success")
onClose();
}
})
.catch((error) => {
showToast(error.message, "error");
.catch( ( error ) =>
{
setIsSubmitting(false)
const message = error.response.data.message || error.message || "Error Occured During Api Call"
showToast( message, "error" );
});
};