diff --git a/src/hooks/useAllRolesData/useAllRolesData.js b/src/hooks/useAllRolesData/useAllRolesData.js index 53d75d918..542a07077 100644 --- a/src/hooks/useAllRolesData/useAllRolesData.js +++ b/src/hooks/useAllRolesData/useAllRolesData.js @@ -20,8 +20,8 @@ function useAllRolesData() { const [namespace] = useNamespace(); const { data, isLoading, isSuccess } = useQuery([namespace, 'user-roles'], () => { - return stripes.hasInterface('roles') && ky.get(`roles?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby name`).json(); - }); + return ky.get(`roles?limit=${stripes.config.maxUnpagedResourceCount}&query=cql.allRecords=1 sortby name`).json(); + }, { enabled: stripes.hasInterface('roles') }); const allRolesMapStructure = useMemo(() => { const rolesMap = new Map();