mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
Merge pull request #3 from sarvika/litellm_project_filter_usage_page
fix: narrow unknown UI settings value before passing to PageVisibility
This commit is contained in:
commit
244de9798b
1 changed files with 5 additions and 1 deletions
|
|
@ -45,6 +45,10 @@ function SettingRow({
|
|||
);
|
||||
}
|
||||
|
||||
function toStringArrayOrNull(value: unknown): string[] | null {
|
||||
return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : null;
|
||||
}
|
||||
|
||||
export default function UISettings() {
|
||||
const { accessToken } = useAuthorized();
|
||||
const { data, isLoading, isError, error } = useUISettings();
|
||||
|
|
@ -434,7 +438,7 @@ export default function UISettings() {
|
|||
|
||||
<Separator />
|
||||
<PageVisibilitySettings
|
||||
enabledPagesInternalUsers={values.enabled_ui_pages_internal_users}
|
||||
enabledPagesInternalUsers={toStringArrayOrNull(values.enabled_ui_pages_internal_users)}
|
||||
enabledPagesPropertyDescription={enabledPagesProperty?.description}
|
||||
isUpdating={isUpdating}
|
||||
onUpdate={handleUpdatePageVisibility}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue