Похоже работает
This commit is contained in:
@@ -75,8 +75,15 @@
|
||||
const method = editingProvider ? 'PUT' : 'POST';
|
||||
const endpoint = editingProvider ? `/llm/providers/${editingProvider.id}` : '/llm/providers';
|
||||
|
||||
// When editing, only include api_key if user entered a new one
|
||||
const submitData = { ...formData };
|
||||
if (editingProvider && !submitData.api_key) {
|
||||
// If editing and api_key is empty, don't send it (backend will keep existing)
|
||||
delete submitData.api_key;
|
||||
}
|
||||
|
||||
try {
|
||||
await requestApi(endpoint, method, formData);
|
||||
await requestApi(endpoint, method, submitData);
|
||||
showForm = false;
|
||||
resetForm();
|
||||
onSave();
|
||||
|
||||
Reference in New Issue
Block a user