fix(tkpurchase): 체크아웃 폼 worker_names 없을 때 actual_worker_count만큼 빈 행 생성
체크인 시 작업자 이름 미입력 + 인원 수만 입력한 경우 체크아웃 폼에 빈 행 1개만 표시되던 버그 수정 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -169,8 +169,11 @@ async function showCheckoutForm(checkinId, scheduleId) {
|
|||||||
}
|
}
|
||||||
if (workerNames.length > 0) {
|
if (workerNames.length > 0) {
|
||||||
existingWorkers = workerNames.map(name => ({ worker_name: name, hours_worked: 8.0 }));
|
existingWorkers = workerNames.map(name => ({ worker_name: name, hours_worked: 8.0 }));
|
||||||
} else if (currentUser) {
|
} else {
|
||||||
existingWorkers = [{ worker_name: currentUser.name || '', hours_worked: 8.0 }];
|
const count = Math.max(checkin.actual_worker_count || 1, 1);
|
||||||
|
for (let i = 0; i < count; i++) {
|
||||||
|
existingWorkers.push({ worker_name: '', hours_worked: 8.0 });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user