diff --git a/components/pages/settings/users/UserWebsites.js b/components/pages/settings/users/UserWebsites.js index 144fae44..d61df4d8 100644 --- a/components/pages/settings/users/UserWebsites.js +++ b/components/pages/settings/users/UserWebsites.js @@ -2,12 +2,19 @@ import { Loading } from 'react-basics'; import useApi from 'hooks/useApi'; import WebsitesTable from 'components/pages/settings/websites/WebsitesTable'; import useMessages from 'hooks/useMessages'; +import useApiFilter from 'hooks/useApiFilter'; export function UserWebsites({ userId }) { const { formatMessage, messages } = useMessages(); + const { filter, page, pageSize, handleFilterChange, handlePageChange, handlePageSizeChange } = + useApiFilter(); const { get, useQuery } = useApi(); - const { data, isLoading } = useQuery(['user:websites', userId], () => - get(`/users/${userId}/websites`), + const { data, isLoading } = useQuery(['user:websites', userId, filter, page, pageSize], () => + get(`/users/${userId}/websites`, { + filter, + page, + pageSize, + }), ); const hasData = data && data.length !== 0; @@ -17,7 +24,15 @@ export function UserWebsites({ userId }) { return (
- {hasData && } + {hasData && ( + + )} {!hasData && formatMessage(messages.noDataAvailable)}
);