Skip to content

Commit

Permalink
refactor useAllRolesData.js hook by using enabled field
Browse files Browse the repository at this point in the history
  • Loading branch information
aidynoJ committed Dec 10, 2024
1 parent 6d4e2b4 commit 6552cc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useAllRolesData/useAllRolesData.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 6552cc6

Please sign in to comment.