Skip to content

Commit

Permalink
PR suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ibolton336 committed Mar 19, 2024
1 parent 4796ac1 commit 510144a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions client/src/app/hooks/useAssessmentStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ export const useAssessmentStatus = (application: Application) => {
const { archetypes } = useFetchArchetypes();

return useMemo(() => {
const applicationAssessments = assessments?.filter(
(assessment: Assessment) => assessment.application?.id === application.id
);
const inheritedArchetypes = archetypes?.filter(
(archetype: Archetype) =>
archetype.applications?.map((app) => app.id).includes(application.id)
);
const applicationAssessments =
assessments?.filter(
(assessment: Assessment) =>
assessment.application?.id === application.id
) ?? [];
const inheritedArchetypes =
archetypes?.filter(
(archetype: Archetype) =>
archetype.applications?.map((app) => app.id).includes(application.id)
) ?? [];

const assessmentsWithArchetypes = inheritedArchetypes.map(
(inheritedArchetype) => ({
Expand Down

0 comments on commit 510144a

Please sign in to comment.