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.
This commit is contained in:
2026-02-24 18:16:57 +01:00
parent 4f23c1c653
commit 25005c9ff9

View File

@@ -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,