Skip to content

Commit

Permalink
🐛 Address missing archetype name in delete assessment notification (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 authored Dec 15, 2023
1 parent bb0d2a5 commit 8637733
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ const DynamicAssessmentActionsRow: FunctionComponent<
assessmentId: assessment.id,
applicationName: application?.name,
applicationId: application?.id,
archetypeName: archetype?.name,
archetypeId: archetype?.id,
}).then(() => {
createAssessment();
Expand Down Expand Up @@ -263,6 +264,7 @@ const DynamicAssessmentActionsRow: FunctionComponent<
assessmentId: assessment.id,
applicationName: application?.name,
applicationId: application?.id,
archetypeName: archetype?.name,
archetypeId: archetype?.id,
});
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ export const AssessmentWizard: React.FC<AssessmentWizardProps> = ({
assessmentId: assessment.id,
applicationName: assessment.application?.name,
applicationId: assessment.application?.id,
archetypeName: assessment.archetype?.name,
archetypeId: assessment.archetype?.id,
});
} else {
Expand All @@ -455,6 +456,7 @@ export const AssessmentWizard: React.FC<AssessmentWizardProps> = ({
assessmentId: assessment.id,
applicationName: assessment.application?.name,
applicationId: assessment.application?.id,
archetypeName: assessment.archetype?.name,
archetypeId: assessment.archetype?.id,
});
}
Expand Down
6 changes: 4 additions & 2 deletions client/src/app/queries/assessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const useUpdateAssessmentMutation = (
};

export const useDeleteAssessmentMutation = (
onSuccess?: (applicationName: string) => void,
onSuccess?: (name: string) => void,
onError?: (err: AxiosError) => void
) => {
const queryClient = useQueryClient();
Expand All @@ -117,6 +117,7 @@ export const useDeleteAssessmentMutation = (
assessmentId: number;
applicationName?: string;
applicationId?: number;
archetypeName?: string;
archetypeId?: number;
}) => {
const deletedAssessment = deleteAssessment(args.assessmentId);
Expand All @@ -138,7 +139,8 @@ export const useDeleteAssessmentMutation = (
return deletedAssessment;
},
onSuccess: (_, args) => {
onSuccess && onSuccess(args?.applicationName || "Unknown");
onSuccess &&
onSuccess(args?.applicationName || args?.archetypeName || "Unknown");
},
onError: onError,
});
Expand Down

0 comments on commit 8637733

Please sign in to comment.