mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
fix: exclude defaults from hasValues check to avoid overwriting router settings
enable_tag_filtering: false (the default) passed the hasValues guard, causing every team save to send router_settings even for teams that never had them configured. This could silently overwrite backend-set values. Now exclude false and empty arrays from the check.
This commit is contained in:
parent
ce6973109a
commit
4ba9219e1d
1 changed files with 9 additions and 2 deletions
|
|
@ -591,11 +591,18 @@ const TeamInfoView: React.FC<TeamInfoProps> = ({
|
|||
updateData.access_group_ids = values.access_group_ids;
|
||||
}
|
||||
|
||||
// Handle router_settings - read fresh values from DOM at save time
|
||||
// Handle router_settings - read fresh values from DOM at save time.
|
||||
// Only include if the user actually configured something meaningful
|
||||
// (exclude defaults like enable_tag_filtering: false and empty arrays).
|
||||
const currentRouterSettings = routerSettingsRef.current?.getValue();
|
||||
if (currentRouterSettings?.router_settings) {
|
||||
const hasValues = Object.values(currentRouterSettings.router_settings).some(
|
||||
(value) => value !== null && value !== undefined && value !== "",
|
||||
(value) =>
|
||||
value !== null &&
|
||||
value !== undefined &&
|
||||
value !== "" &&
|
||||
value !== false &&
|
||||
!(Array.isArray(value) && value.length === 0),
|
||||
);
|
||||
if (hasValues) {
|
||||
updateData.router_settings = currentRouterSettings.router_settings;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue