From 8b1ecb8d1eeb341ef5462c614e36f13447d60860 Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke@nordu.net> Date: Fri, 30 May 2025 13:24:43 +0200 Subject: [PATCH] Fix validity check for staffgraph --- compendium-frontend/src/pages/Organization/StaffGraph.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compendium-frontend/src/pages/Organization/StaffGraph.tsx b/compendium-frontend/src/pages/Organization/StaffGraph.tsx index 68a5684a..4b11e80b 100644 --- a/compendium-frontend/src/pages/Organization/StaffGraph.tsx +++ b/compendium-frontend/src/pages/Organization/StaffGraph.tsx @@ -107,8 +107,8 @@ interface inputProps { function StaffGraphPage({ roles = false }: inputProps) { function validityCheck(staffdata: NrenStaff) { - return (roles && staffdata.technical_fte > 0 && staffdata.non_technical_fte > 0) || - (!roles && staffdata.permanent_fte > 0 && staffdata.subcontracted_fte > 0); + return (roles && (staffdata.technical_fte > 0 || staffdata.non_technical_fte > 0)) || + (!roles && (staffdata.permanent_fte > 0 || staffdata.subcontracted_fte > 0)); } const { filterSelection, setFilterSelection } = useContext(FilterSelectionContext); const { data, years, nrens } = useData<NrenStaff>('/api/staff', setFilterSelection, validityCheck); -- GitLab