fix: resolve TypeScript error in apiFetch headers

fix: resolve TypeScript error in apiFetch headers
This commit is contained in:
Gabriel Menezes 2026-05-21 19:19:37 -04:00 committed by GitHub
commit 8cfae110c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -22,12 +22,12 @@ export async function apiFetch<T>(path: string, options: RequestOptions = {}) {
}
const isFormData = body instanceof FormData
const contentTypeHeader = isFormData ? {} : { 'Content-Type': 'application/json' }
const defaultHeaders: Record<string, string> = isFormData ? {} : { 'Content-Type': 'application/json' }
const response = await fetch(buildUrl(path), {
...rest,
headers: {
...contentTypeHeader,
...defaultHeaders,
...authHeader,
...headers,
},