fix search feature
Build & Push / Pipeline Tests (push) Failing after 1m14s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 53s
Test / API Unit Tests (push) Failing after 50s
Test / Homepage Unit Tests (push) Successful in 45s
Test / Carplace Unit Tests (push) Successful in 44s
Test / Admin Unit Tests (push) Successful in 42s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Successful in 1m4s

This commit is contained in:
root
2026-07-26 01:18:05 -04:00
parent f6fcd7ce54
commit 2b422ca197
23 changed files with 880 additions and 51 deletions
+11 -1
View File
@@ -34,6 +34,16 @@ export function resolveApiBase(): string {
return normalizeApiBase(shouldUseDashboardProxy(configuredApiBase) ? DASHBOARD_PROXY_API_BASE : (configuredApiBase || DASHBOARD_PROXY_API_BASE))
}
export function resolveApiOrigin(): string | null {
if (typeof window === 'undefined') return null
try {
return new URL(resolveApiBase(), window.location.origin).origin
} catch {
return window.location.origin
}
}
export const API_BASE = resolveApiBase()
export const EMPLOYEE_PROFILE_KEY = 'employee_profile'
@@ -45,7 +55,7 @@ export async function apiFetch<T>(path: string, options?: RequestInit): Promise<
...(options?.headers as Record<string, string> ?? {}),
}
if (!isFormData) {
if (!isFormData && options?.body !== undefined) {
headers['Content-Type'] = 'application/json'
}