Skip to content

Commit 6765bd0

Browse files
authored
Fix remove tier error handling (#3375)
1 parent 5f7b563 commit 6765bd0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

web-app/src/screens/Console/Configurations/TiersConfiguration/DeleteTierConfirmModal.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
import React from "react";
1818
import { ConfirmModalIcon } from "mds";
1919
import { api } from "api";
20-
import { errorToHandler } from "api/errors";
21-
import { setModalErrorSnackMessage } from "../../../../systemSlice";
20+
import { setErrorSnackMessage } from "../../../../systemSlice";
2221
import { useAppDispatch } from "../../../../store";
2322
import ConfirmDialog from "screens/Console/Common/ModalWrapper/ConfirmDialog";
2423

@@ -43,10 +42,18 @@ const DeleteTierConfirmModal = ({
4342
closeModalAndRefresh(true);
4443
})
4544
.catch((err) => {
46-
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
45+
err.json().then((body: any) => {
46+
dispatch(
47+
setErrorSnackMessage({
48+
errorMessage: body.message,
49+
detailedError: body.detailedMessage,
50+
}),
51+
);
52+
});
53+
closeModalAndRefresh(false);
4754
});
4855
} else {
49-
setModalErrorSnackMessage({
56+
setErrorSnackMessage({
5057
errorMessage: "There was an error deleting the tier",
5158
detailedError: "",
5259
});

0 commit comments

Comments
 (0)