diff --git a/packages/manager/.changeset/pr-10230-upcoming-features-1708982538087.md b/packages/manager/.changeset/pr-10230-upcoming-features-1708982538087.md new file mode 100644 index 00000000000..9d3ae547592 --- /dev/null +++ b/packages/manager/.changeset/pr-10230-upcoming-features-1708982538087.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Fix Users & Grants filtering error based on `user_type` ([#10230](https://github.com/linode/manager/pull/10230)) diff --git a/packages/manager/src/features/Users/UsersLanding.tsx b/packages/manager/src/features/Users/UsersLanding.tsx index e7d86191574..c218a8fde6f 100644 --- a/packages/manager/src/features/Users/UsersLanding.tsx +++ b/packages/manager/src/features/Users/UsersLanding.tsx @@ -33,15 +33,16 @@ export const UsersLanding = () => { const pagination = usePagination(1, 'account-users'); const order = useOrder(); + const showProxyUserTable = + flags.parentChildAccountAccess && + (profile?.user_type === 'child' || profile?.user_type === 'proxy'); + const usersFilter: Filter = { ['+order']: order.order, ['+order_by']: order.orderBy, + ['user_type']: showProxyUserTable ? 'child' : undefined, }; - if (flags.parentChildAccountAccess) { - usersFilter['user_type'] = { '+neq': 'proxy' }; - } - const { data: users, error, isLoading, refetch } = useAccountUsers({ filters: usersFilter, params: { @@ -61,10 +62,6 @@ export const UsersLanding = () => { const isRestrictedUser = profile?.restricted; - const showProxyUserTable = - flags.parentChildAccountAccess && - (profile?.user_type === 'child' || profile?.user_type === 'proxy'); - const showChildAccountAccessCol = Boolean( flags.parentChildAccountAccess && profile?.user_type === 'parent' ); @@ -100,7 +97,7 @@ export const UsersLanding = () => {