Skip to content

Commit

Permalink
🐛 No need to create multiple assessments for associated archetypes
Browse files Browse the repository at this point in the history
Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 committed Dec 18, 2023
1 parent 67ab924 commit 84ade79
Showing 1 changed file with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,25 @@ const DynamicAssessmentActionsRow: FunctionComponent<
};

const takeAssessment = async () => {
if (!isArchetype && application?.archetypes?.length) {
for (const archetypeRef of application.archetypes) {
try {
createAssessment();
} catch (error) {
console.error(
`Error fetching archetype with ID ${archetypeRef.id}:`,
error
);
pushNotification({
title: t("terms.error"),
variant: "danger",
});
}
}
} else {
try {
createAssessment();
} catch (error) {
if (isArchetype) {
console.error(
`Error fetching archetype with ID ${archetype?.id}:`,
error
);
} else {
console.error(
`Error fetching application with ID ${application?.id}:`,
error
);
}

pushNotification({
title: t("terms.error"),
variant: "danger",
});
}
};

Expand Down

0 comments on commit 84ade79

Please sign in to comment.