Scope manual sync buttons to current view dates only

Sync rota and pull timesheets now operate on the 7-day view window rather
than rolling default windows — reduces API calls and allows backdating.
Cron job still uses rolling defaults via runRotaSync()/runTimesheetSync().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-07-22 20:08:43 +00:00
parent 9bfd14a082
commit ffefa1914f
9 changed files with 81 additions and 60 deletions

View file

@ -116,12 +116,12 @@ export function putWorkforceDepartments(dept_ids: string[]): Promise<{ ok: boole
})
}
export function syncWorkforce(): Promise<{ ok: boolean; from: string; to: string; dates_synced: number }> {
return request('/workforce/sync', { method: 'POST' })
export function syncWorkforce(start: string, end: string): Promise<{ ok: boolean; from: string; to: string; dates_synced: number }> {
return request(`/workforce/sync?start=${start}&end=${end}`, { method: 'POST' })
}
export function syncTimesheets(): Promise<{ ok: boolean; from: string; to: string; dates_synced: number }> {
return request('/workforce/sync-timesheets', { method: 'POST' })
export function syncTimesheets(start: string, end: string): Promise<{ ok: boolean; from: string; to: string; dates_synced: number }> {
return request(`/workforce/sync-timesheets?start=${start}&end=${end}`, { method: 'POST' })
}
export function getWorkforceShifts(start: string, end: string): Promise<Record<string, WfDayData>> {