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
@@ -452,9 +452,10 @@ const getToken = () => {
const apiFetch = async (url: string, options: RequestInit = {}, isCMS: boolean = false) => {
const token = getToken();
const baseUrl = isCMS ? getCmsApiUrl() : getLmsApiUrl();
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}` } : {})
};