litellm/ui
Cursor Agent f8f40c4284
fix(ui): stop useCan from firing /organization/list on every page
useCan wraps useIsOrgAdmin which unconditionally called useOrganizations, so
every gated page hit /organization/list even for capabilities that only look
at the session role. That broke three page integration tests that assert
fetch is not called for a non-admin, and it broke three cost-optimization
tests where the extra useQuery threw because they rendered without a
QueryClientProvider.

Skip the fetch when the capability isn't in ORG_ADMIN_CAPABILITIES, and wrap
the three cost-optimization test files with the shared providers helper so
the still-necessary useQuery has a client.

Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-08-11 04:38:22 +00:00
..
litellm-dashboard fix(ui): stop useCan from firing /organization/list on every page 2026-08-11 04:38:22 +00:00
Dockerfile chore(build): move the Admin UI toolchain to Node 24 (#35801) 2026-08-04 12:36:07 -07:00
nginx.conf fix(ui): serve /ui/assets from the nginx image instead of SPA fallback (#34066) 2026-07-21 09:22:02 -07:00