From 2a41e5cf86c752a7de68d117b385cf6d07ecd332 Mon Sep 17 00:00:00 2001 From: Gabriel Santana de Menezes Date: Thu, 21 May 2026 19:17:41 -0400 Subject: [PATCH] fix: resolve TypeScript error in apiFetch headers Type the defaultHeaders as Record to fix TS2322 error when spreading headers into fetch options. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index c25d7e3..1d583ea 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -22,12 +22,12 @@ export async function apiFetch(path: string, options: RequestOptions = {}) { } const isFormData = body instanceof FormData - const contentTypeHeader = isFormData ? {} : { 'Content-Type': 'application/json' } + const defaultHeaders: Record = isFormData ? {} : { 'Content-Type': 'application/json' } const response = await fetch(buildUrl(path), { ...rest, headers: { - ...contentTypeHeader, + ...defaultHeaders, ...authHeader, ...headers, },