From 5a786263bc2501684593c2c1aa0b56b1d20a56ed Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Wed, 18 Feb 2026 03:15:03 +0700 Subject: [PATCH] fix(ui): replace stale BASE_URL references in api client - use withApiBase for config yaml, auth file, and error log endpoints - resolve UI build/typecheck failure in CI validate job --- ui/src/lib/api-client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/lib/api-client.ts b/ui/src/lib/api-client.ts index 7b28b20c..f3550685 100644 --- a/ui/src/lib/api-client.ts +++ b/ui/src/lib/api-client.ts @@ -490,12 +490,12 @@ export const api = { // Config YAML for Config tab getConfigYaml: async (): Promise => { - const res = await fetch(`${BASE_URL}/cliproxy/config.yaml`); + const res = await fetch(withApiBase('/cliproxy/config.yaml')); if (!res.ok) throw new Error('Failed to load config'); return res.text(); }, saveConfigYaml: async (content: string): Promise => { - const res = await fetch(`${BASE_URL}/cliproxy/config.yaml`, { + const res = await fetch(withApiBase('/cliproxy/config.yaml'), { method: 'PUT', headers: { 'Content-Type': 'application/yaml' }, body: content, @@ -510,7 +510,7 @@ export const api = { getAuthFiles: () => request<{ files: AuthFile[] }>('/cliproxy/auth-files'), getAuthFile: async (name: string): Promise => { const res = await fetch( - `${BASE_URL}/cliproxy/auth-files/download?name=${encodeURIComponent(name)}` + withApiBase(`/cliproxy/auth-files/download?name=${encodeURIComponent(name)}`) ); if (!res.ok) throw new Error('Failed to load auth file'); return res.text(); @@ -592,7 +592,7 @@ export const api = { list: () => request<{ files: CliproxyErrorLog[] }>('/cliproxy/error-logs'), /** Get content of a specific error log */ getContent: async (name: string): Promise => { - const res = await fetch(`${BASE_URL}/cliproxy/error-logs/${encodeURIComponent(name)}`); + const res = await fetch(withApiBase(`/cliproxy/error-logs/${encodeURIComponent(name)}`)); if (!res.ok) throw new Error('Failed to load error log'); return res.text(); },