fix(proxy): freeze merged user-filter where, format create key test

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
jesus 2026-09-08 22:54:46 +00:00
parent 01dfbb29ca
commit 3bd212a3fa
2 changed files with 10 additions and 9 deletions

View file

@ -2694,11 +2694,13 @@ async def ui_view_users(
if org_filter_ids is not None:
where_conditions["organization_memberships"] = {"some": {"organization_id": {"in": org_filter_ids}}}
where: Final[Mapping[str, object]] = {
key: value
for key, value in (*where_conditions.items(), *_user_search_where(search).items())
if value is not None
}
where: Final[Mapping[str, object]] = MappingProxyType(
{
key: value
for key, value in (*where_conditions.items(), *_user_search_where(search).items())
if value is not None
}
)
# Query users with pagination and filters
users: Final = await _user_table(prisma_client).find_many(

View file

@ -189,7 +189,8 @@ const openModal = async (props: Partial<React.ComponentProps<typeof CreateKey>>
return view;
};
const userSearchInput = (): Promise<HTMLElement> => screen.findByPlaceholderText("Type email or user ID to search for users");
const userSearchInput = (): Promise<HTMLElement> =>
screen.findByPlaceholderText("Type email or user ID to search for users");
const openSection = async (name: RegExp) => {
await userEvent.click(await screen.findByRole("button", { name }));
@ -1022,9 +1023,7 @@ describe("CreateKey", () => {
];
vi.mocked(userFilterUICall).mockImplementation(
(_accessToken, params) =>
Promise.resolve(
directory.filter((entry) => entry.user_email.includes(params.get("search") ?? "")),
) as never,
Promise.resolve(directory.filter((entry) => entry.user_email.includes(params.get("search") ?? ""))) as never,
);
const user = userEvent.setup({ advanceTimers: vi.advanceTimersByTime });