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