fix(tkpurchase): 체크아웃 폼 worker_names 없을 때 actual_worker_count만큼 빈 행 생성

체크인 시 작업자 이름 미입력 + 인원 수만 입력한 경우 체크아웃 폼에 빈 행 1개만 표시되던 버그 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-13 13:59:18 +09:00
parent 6e5c1554d0
commit 5a062759c5

View File

@@ -169,8 +169,11 @@ async function showCheckoutForm(checkinId, scheduleId) {
}
if (workerNames.length > 0) {
existingWorkers = workerNames.map(name => ({ worker_name: name, hours_worked: 8.0 }));
} else if (currentUser) {
existingWorkers = [{ worker_name: currentUser.name || '', hours_worked: 8.0 }];
} else {
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 });
}
}
}