mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
fix(ui): allow internal users to trigger useProjects query
This commit is contained in:
parent
9d41cb83b8
commit
57d6500d5f
1 changed files with 4 additions and 2 deletions
|
|
@ -6,7 +6,7 @@ import {
|
|||
deriveErrorMessage,
|
||||
handleError,
|
||||
} from "@/components/networking";
|
||||
import { all_admin_roles } from "@/utils/roles";
|
||||
import { all_admin_roles, internalUserRoles } from "@/utils/roles";
|
||||
import useAuthorized from "@/app/(dashboard)/hooks/useAuthorized";
|
||||
|
||||
// ── Types ────────────────────────────────────────────────────────────────────
|
||||
|
|
@ -82,6 +82,8 @@ export const useProjects = () => {
|
|||
queryKey: projectKeys.list({}),
|
||||
queryFn: async () => fetchProjects(accessToken!),
|
||||
enabled:
|
||||
Boolean(accessToken) && all_admin_roles.includes(userRole || ""),
|
||||
Boolean(accessToken) &&
|
||||
(all_admin_roles.includes(userRole || "") ||
|
||||
internalUserRoles.includes(userRole || "")),
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue