Fix duplicate const cur declaration in sync route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
69720b778a
commit
109a4ea194
1 changed files with 4 additions and 4 deletions
|
|
@ -68,11 +68,11 @@ export async function workforceRoutes(app) {
|
|||
|
||||
// Build a row for every date in the window (empty staff = no one scheduled)
|
||||
const dailyRows = []
|
||||
const cur = new Date(fromDate)
|
||||
while (cur <= toDate) {
|
||||
const d = fmtDate(cur)
|
||||
const day = new Date(fromDate)
|
||||
while (day <= toDate) {
|
||||
const d = fmtDate(day)
|
||||
dailyRows.push({ date: d, staff: byDate[d] || [] })
|
||||
cur.setDate(cur.getDate() + 1)
|
||||
day.setDate(day.getDate() + 1)
|
||||
}
|
||||
|
||||
await upsertWorkforceShifts(dailyRows)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue