feat: Implement default branding synchronization and improve API header handling.

This commit is contained in:
2026-03-09 17:55:10 -03:00
parent bde5be22e7
commit 2fe6dcea59
10 changed files with 84 additions and 50 deletions
+4 -3
View File
@@ -594,9 +594,10 @@ const apiFetch = (url: string, options: RequestInit = {}, isLms: boolean = false
const token = getToken();
const selectedOrgId = getSelectedOrgId();
const baseUrl = isLms ? LMS_API_BASE_URL : API_BASE_URL;
const headers = {
'Content-Type': 'application/json',
...options.headers,
const isFormData = options.body instanceof FormData;
const headers: Record<string, string> = {
...(isFormData ? {} : { 'Content-Type': 'application/json' }),
...Object.fromEntries(Object.entries(options.headers || {}).map(([k, v]) => [k, String(v)])),
...(token ? { 'Authorization': `Bearer ${token}` } : {}),
...(selectedOrgId ? { 'X-Organization-Id': selectedOrgId } : {})
};