fix(ui): correct cliproxy account API paths

- Change /cliproxy/accounts/* to /cliproxy/auth/accounts/*
- Fix 404 errors when managing CLIProxy accounts from dashboard
- Root cause: frontend called wrong endpoints for account management
This commit is contained in:
kaitranntt
2025-12-21 18:02:38 -05:00
parent a8bda073fb
commit e84df00740
+6 -4
View File
@@ -307,16 +307,18 @@ export const api = {
// Multi-account management // Multi-account management
accounts: { accounts: {
list: () => request<{ accounts: ProviderAccountsMap }>('/cliproxy/accounts'), list: () => request<{ accounts: ProviderAccountsMap }>('/cliproxy/auth/accounts'),
listByProvider: (provider: string) => listByProvider: (provider: string) =>
request<{ provider: string; accounts: OAuthAccount[] }>(`/cliproxy/accounts/${provider}`), request<{ provider: string; accounts: OAuthAccount[] }>(
`/cliproxy/auth/accounts/${provider}`
),
setDefault: (provider: string, accountId: string) => setDefault: (provider: string, accountId: string) =>
request(`/cliproxy/accounts/${provider}/default`, { request(`/cliproxy/auth/accounts/${provider}/default`, {
method: 'POST', method: 'POST',
body: JSON.stringify({ accountId }), body: JSON.stringify({ accountId }),
}), }),
remove: (provider: string, accountId: string) => remove: (provider: string, accountId: string) =>
request(`/cliproxy/accounts/${provider}/${accountId}`, { method: 'DELETE' }), request(`/cliproxy/auth/accounts/${provider}/${accountId}`, { method: 'DELETE' }),
}, },
// OAuth flow // OAuth flow
auth: { auth: {