Skip to content

Commit

Permalink
Fix remove tier error handling (#3375)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinapurapu authored Jun 7, 2024
1 parent 5f7b563 commit 6765bd0
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import React from "react";
import { ConfirmModalIcon } from "mds";
import { api } from "api";
import { errorToHandler } from "api/errors";
import { setModalErrorSnackMessage } from "../../../../systemSlice";
import { setErrorSnackMessage } from "../../../../systemSlice";
import { useAppDispatch } from "../../../../store";
import ConfirmDialog from "screens/Console/Common/ModalWrapper/ConfirmDialog";

Expand All @@ -43,10 +42,18 @@ const DeleteTierConfirmModal = ({
closeModalAndRefresh(true);
})
.catch((err) => {
dispatch(setModalErrorSnackMessage(errorToHandler(err.error)));
err.json().then((body: any) => {
dispatch(
setErrorSnackMessage({
errorMessage: body.message,
detailedError: body.detailedMessage,
}),
);
});
closeModalAndRefresh(false);
});
} else {
setModalErrorSnackMessage({
setErrorSnackMessage({
errorMessage: "There was an error deleting the tier",
detailedError: "",
});
Expand Down

0 comments on commit 6765bd0

Please sign in to comment.