Skip to content

Commit

Permalink
remove spread operation
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholas-codecov committed Dec 23, 2024
1 parent 0ebe68e commit 522581a
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/pages/AdminSettings/AdminMembers/MemberList/MemberTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,25 @@ interface Params {
}

const useQueryMembersList = (params: Params) => {
const { data: queryData, ...rest } = useInfiniteQueryV5(
SelfHostedUserListQueryOpts(params)
)
const {
data: queryData,
isFetchingNextPage,
hasNextPage,
fetchNextPage,
isLoading,
} = useInfiniteQueryV5(SelfHostedUserListQueryOpts(params))

const flatUsersList = useMemo(
() => queryData?.pages?.flatMap((page) => page.results) ?? [],
[queryData?.pages]
)

return {
...rest,
data: flatUsersList,
isFetchingNextPage,
hasNextPage,
fetchNextPage,
isLoading,
}
}

Expand Down

0 comments on commit 522581a

Please sign in to comment.