fix(account): preserve existing credentials when saving apikey accounts

When editing an apikey account, the credentials object was built from
scratch, causing fields like tier_id that are not exposed in the UI to
be silently dropped on save. Spread currentCredentials first so unknown
fields are retained, then let the known fields overwrite them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Gemini Wen
2026-03-06 20:15:42 +08:00
parent afbe8bf001
commit a087f089b8

View File

@@ -2254,6 +2254,7 @@ const handleSubmit = async () => {
// Always update credentials for apikey type to handle model mapping changes // Always update credentials for apikey type to handle model mapping changes
const newCredentials: Record<string, unknown> = { const newCredentials: Record<string, unknown> = {
...currentCredentials,
base_url: newBaseUrl base_url: newBaseUrl
} }