handeling the export fail

This commit is contained in:
srinivaspendem 2023-08-11 12:34:15 +05:30
parent a1f0b9c253
commit b84ca669c6

View File

@ -64,6 +64,7 @@ export const Exporter: React.FC<Props> = ({
.then(() => { .then(() => {
mutateServices(); mutateServices();
router.push(`/${workspaceSlug}/settings/export`); router.push(`/${workspaceSlug}/settings/export`);
setExportLoading(false);
setToastAlert({ setToastAlert({
type: "success", type: "success",
title: "Export Successful", title: "Export Successful",
@ -78,13 +79,14 @@ export const Exporter: React.FC<Props> = ({
} from the previous export.`, } from the previous export.`,
}); });
}) })
.catch(() => .catch(() => {
setExportLoading(false);
setToastAlert({ setToastAlert({
type: "error", type: "error",
title: "Error!", title: "Error!",
message: "Export was unsuccessful. Please try again.", message: "Export was unsuccessful. Please try again.",
}) });
); });
} }
}; };