mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix: treat empty router settings inputs as null instead of preserving old values
When a user clears a numeric field in the RouterSettingsAccordion, the empty input should result in null, not fall through to the previous value from state.
This commit is contained in:
parent
7654234f20
commit
f93db822fd
1 changed files with 7 additions and 3 deletions
|
|
@ -241,9 +241,13 @@ const RouterSettingsAccordion = forwardRef<RouterSettingsAccordionRef, RouterSet
|
|||
key !== "fallbacks"
|
||||
) {
|
||||
const inputEl = document.querySelector(`input[name="${key}"]`) as HTMLInputElement | null;
|
||||
if (inputEl && inputEl.value !== undefined && inputEl.value !== "") {
|
||||
const parsed = parseInputValue(key, inputEl.value, value);
|
||||
return [key, parsed];
|
||||
if (inputEl) {
|
||||
if (inputEl.value !== undefined && inputEl.value !== "") {
|
||||
const parsed = parseInputValue(key, inputEl.value, value);
|
||||
return [key, parsed];
|
||||
}
|
||||
// Input exists but is empty — user cleared it, set to null
|
||||
return [key, null];
|
||||
}
|
||||
return [key, value];
|
||||
} else if (key === "routing_strategy") {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue