forked from github/plane
fix: Delete estimate popup is not closing automatically (#2777)
This commit is contained in:
parent
29774ce84a
commit
96f6e37cc5
@ -40,16 +40,22 @@ export const DeleteEstimateModal: React.FC<Props> = observer((props) => {
|
|||||||
|
|
||||||
const estimateId = data?.id!;
|
const estimateId = data?.id!;
|
||||||
|
|
||||||
projectEstimatesStore.deleteEstimate(workspaceSlug.toString(), projectId.toString(), estimateId).catch((err) => {
|
projectEstimatesStore
|
||||||
const error = err?.error;
|
.deleteEstimate(workspaceSlug.toString(), projectId.toString(), estimateId)
|
||||||
const errorString = Array.isArray(error) ? error[0] : error;
|
.then(() => {
|
||||||
|
setIsDeleteLoading(false);
|
||||||
|
handleClose();
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
const error = err?.error;
|
||||||
|
const errorString = Array.isArray(error) ? error[0] : error;
|
||||||
|
|
||||||
setToastAlert({
|
setToastAlert({
|
||||||
type: "error",
|
type: "error",
|
||||||
title: "Error!",
|
title: "Error!",
|
||||||
message: errorString ?? "Estimate could not be deleted. Please try again",
|
message: errorString ?? "Estimate could not be deleted. Please try again",
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user