From 25005c9ff93d3b4442879d37f3053c895acb08be Mon Sep 17 00:00:00 2001 From: Simon Franken Date: Tue, 24 Feb 2026 18:16:57 +0100 Subject: [PATCH] fix: correctly pass client.id when creating target in ClientTargetPanel The ClientTargetPanel component now properly uses the client prop to access client.id when creating a new target, instead of trying to access target?.clientId which would be undefined during creation. This ensures new targets are properly associated with the correct client. --- frontend/src/pages/ClientsPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/pages/ClientsPage.tsx b/frontend/src/pages/ClientsPage.tsx index 4db8437..9e711fa 100644 --- a/frontend/src/pages/ClientsPage.tsx +++ b/frontend/src/pages/ClientsPage.tsx @@ -66,6 +66,7 @@ const WEEKDAY_FULL_NAMES = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Frida // Inline target panel shown inside each client card function ClientTargetPanel({ + client, target, onCreated, onDeleted, @@ -159,7 +160,7 @@ function ClientTargetPanel({ }); } else { await onCreated({ - clientId: target?.clientId || '', + clientId: client.id, periodType: formPeriodType, targetHours: hours, startDate: formStartDate,