Skip to content

Commit

Permalink
change variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Nov 26, 2024
1 parent 9e3b6e4 commit 156b123
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/queries/useUserTenantPermissions/useUserTenantPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ const useUserTenantPermissions = (
},
);

const centralTenantPermissions = data.permissionNames || INITIAL_DATA;
const tenantPermissions = data.permissionNames || INITIAL_DATA;

const flattenCentralTenantPermissions = useMemo(() => {
const flattenTenantPermissions = useMemo(() => {
const permSet = new Set();

centralTenantPermissions.forEach(perm => {
tenantPermissions.forEach(perm => {
permSet.add(perm.permissionName);

perm.subPermissions?.forEach(subPermission => {
Expand All @@ -63,12 +63,12 @@ const useUserTenantPermissions = (
});

return permSet;
}, [centralTenantPermissions]);
}, [tenantPermissions]);

return ({
isFetching,
isLoading,
userPermissions: flattenCentralTenantPermissions,
userPermissions: flattenTenantPermissions,
totalRecords: data.totalRecords,
});
};
Expand Down

0 comments on commit 156b123

Please sign in to comment.