Unverified Commit cd69a7cb authored by Wesley Liddick's avatar Wesley Liddick Committed by GitHub
Browse files

Merge pull request #820 from geminiwen/fix/apikey-credentials-preserve-existing-fields

fix(account): preserve existing credentials when saving apikey accounts
parents 0c9ba9e8 9f7ad475
...@@ -2254,6 +2254,7 @@ const handleSubmit = async () => { ...@@ -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
} }
...@@ -2274,6 +2275,8 @@ const handleSubmit = async () => { ...@@ -2274,6 +2275,8 @@ const handleSubmit = async () => {
const modelMapping = buildModelMappingObject(modelRestrictionMode.value, allowedModels.value, modelMappings.value) const modelMapping = buildModelMappingObject(modelRestrictionMode.value, allowedModels.value, modelMappings.value)
if (modelMapping) { if (modelMapping) {
newCredentials.model_mapping = modelMapping newCredentials.model_mapping = modelMapping
} else {
delete newCredentials.model_mapping
} }
} else if (currentCredentials.model_mapping) { } else if (currentCredentials.model_mapping) {
newCredentials.model_mapping = currentCredentials.model_mapping newCredentials.model_mapping = currentCredentials.model_mapping
...@@ -2283,6 +2286,9 @@ const handleSubmit = async () => { ...@@ -2283,6 +2286,9 @@ const handleSubmit = async () => {
if (customErrorCodesEnabled.value) { if (customErrorCodesEnabled.value) {
newCredentials.custom_error_codes_enabled = true newCredentials.custom_error_codes_enabled = true
newCredentials.custom_error_codes = [...selectedErrorCodes.value] newCredentials.custom_error_codes = [...selectedErrorCodes.value]
} else {
delete newCredentials.custom_error_codes_enabled
delete newCredentials.custom_error_codes
} }
// Add intercept warmup requests setting // Add intercept warmup requests setting
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment