diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 12c85d8..e8bb7a4 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -3,9 +3,10 @@ import type { DeptActuals, DeptScheduled, NetSalesDay, WageBudget, AppSetting } const BASE = '/wages/api' async function request(path: string, opts: RequestInit = {}): Promise { + const headers: Record = opts.body != null ? { 'Content-Type': 'application/json' } : {} const res = await fetch(`${BASE}${path}`, { credentials: 'include', - headers: { 'Content-Type': 'application/json', ...opts.headers }, + headers: { ...headers, ...opts.headers }, ...opts, }) if (res.status === 401) {