From 510144a68731bf57a1f5d7d4f312167e24521836 Mon Sep 17 00:00:00 2001 From: Ian Bolton Date: Tue, 19 Mar 2024 17:18:45 -0400 Subject: [PATCH] PR suggestions --- client/src/app/hooks/useAssessmentStatus.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/client/src/app/hooks/useAssessmentStatus.ts b/client/src/app/hooks/useAssessmentStatus.ts index 353647ae5d..a99a5916ac 100644 --- a/client/src/app/hooks/useAssessmentStatus.ts +++ b/client/src/app/hooks/useAssessmentStatus.ts @@ -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) => ({