mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-13 23:11:40 +00:00
fix: narrow unknown UI settings value before passing to PageVisibilitySettings
Type error in build-ui CI: values.enabled_ui_pages_internal_users is Record<string, unknown> and was passed directly into a prop typed string[] | null | undefined.
This commit is contained in:
parent
dd7d8e7adf
commit
b9df1f3908
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