Skip to content

Commit

Permalink
🐛 Fix crashing app when deleting (konveyor#1202)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Jul 26, 2023
1 parent ca340c0 commit 92bf4c7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,14 @@ export const ApplicationsTableAnalyze: React.FC = () => {
}),
variant: "success",
});
refetch();
activeAppInDetailDrawer && closeDetailDrawer();
};

const onDeleteApplicationError = (error: AxiosError) => {
pushNotification({
title: getAxiosErrorMessage(error),
variant: "danger",
});
refetch();
};

const { mutate: deleteApplication } = useDeleteApplicationMutation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,14 @@ export const ApplicationsTable: React.FC = () => {
fetchApplications();
};

// Delete
const onDeleteApplicationSuccess = (appIDCount: number) => {
pushNotification({
title: t("toastr.success.applicationDeleted", {
appIDCount: appIDCount,
}),
variant: "success",
});
fetchApplications();
activeAppInDetailDrawer && closeDetailDrawer();
};

const onDeleteApplicationError = (error: AxiosError) => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/queries/assessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const useFetchApplicationAssessments = (
if (application.id) queryResultsByAppId[application.id] = queryResults[i];
});
return {
getApplicationAssessment: (id: number) => queryResultsByAppId[id].data,
getApplicationAssessment: (id: number) => queryResultsByAppId[id]?.data,
isLoadingApplicationAssessment: (id: number) =>
queryResultsByAppId[id].isLoading,
fetchErrorApplicationAssessment: (id: number) =>
Expand Down

0 comments on commit 92bf4c7

Please sign in to comment.