Skip to content

Commit

Permalink
🐛 Address missing archetype name in delete assessment notification
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Dec 14, 2023
1 parent 1a2f183 commit d8ef9cd
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 @@ -189,6 +189,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 @@ -262,6 +263,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 d8ef9cd

Please sign in to comment.