fix: Delete estimate popup is not closing automatically (#2777)

This commit is contained in:
sabith-tu 2023-11-15 14:08:52 +05:30 committed by sriram veeraghanta
parent a675cd5755
commit 1f904e88e1

View File

@ -40,16 +40,22 @@ export const DeleteEstimateModal: React.FC<Props> = observer((props) => {
const estimateId = data?.id!;
projectEstimatesStore.deleteEstimate(workspaceSlug.toString(), projectId.toString(), estimateId).catch((err) => {
const error = err?.error;
const errorString = Array.isArray(error) ? error[0] : error;
projectEstimatesStore
.deleteEstimate(workspaceSlug.toString(), projectId.toString(), estimateId)
.then(() => {
setIsDeleteLoading(false);
handleClose();
})
.catch((err) => {
const error = err?.error;
const errorString = Array.isArray(error) ? error[0] : error;
setToastAlert({
type: "error",
title: "Error!",
message: errorString ?? "Estimate could not be deleted. Please try again",
setToastAlert({
type: "error",
title: "Error!",
message: errorString ?? "Estimate could not be deleted. Please try again",
});
});
});
};
useEffect(() => {