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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user