From 6552cc69d00db5ebf075386536f83892e756f511 Mon Sep 17 00:00:00 2001 From: aidynoJ Date: Tue, 10 Dec 2024 16:45:20 +0500 Subject: [PATCH] refactor useAllRolesData.js hook by using enabled field --- src/hooks/useAllRolesData/useAllRolesData.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();