diff --git a/next.config.js b/next.config.js
index d0336b10..f353b1f9 100644
--- a/next.config.js
+++ b/next.config.js
@@ -75,7 +75,7 @@ const redirects = [
},
{
source: '/teams/:id',
- destination: '/teams/:id/websites',
+ destination: '/teams/:id/dashboard',
permanent: true,
},
{
diff --git a/src/app/(main)/dashboard/Dashboard.tsx b/src/app/(main)/dashboard/Dashboard.tsx
index 202f88f6..ed976f43 100644
--- a/src/app/(main)/dashboard/Dashboard.tsx
+++ b/src/app/(main)/dashboard/Dashboard.tsx
@@ -7,39 +7,30 @@ import WebsiteChartList from '../websites/[websiteId]/WebsiteChartList';
import DashboardSettingsButton from 'app/(main)/dashboard/DashboardSettingsButton';
import DashboardEdit from 'app/(main)/dashboard/DashboardEdit';
import EmptyPlaceholder from 'components/common/EmptyPlaceholder';
-import { useApi } from 'components/hooks';
+import { useMessages, useLocale, useTeamContext, useWebsites } from 'components/hooks';
import useDashboard from 'store/dashboard';
-import { useMessages, useLocale, useLogin, useFilterQuery } from 'components/hooks';
export function Dashboard() {
const { formatMessage, labels, messages } = useMessages();
- const { user } = useLogin();
+ const { teamId } = useTeamContext();
const { showCharts, editing } = useDashboard();
const { dir } = useLocale();
- const { get } = useApi();
const pageSize = 10;
- const { query, params, setParams, result } = useFilterQuery({
- queryKey: ['dashboard:websites'],
- queryFn: (params: any) => {
- return get(`/users/${user.id}/websites`, { ...params, includeTeams: true, pageSize });
- },
- });
+ const { result, query, params, setParams } = useWebsites({}, { pageSize });
+ const { page } = params;
+ const hasData = !!result?.data;
const handlePageChange = (page: number) => {
setParams({ ...params, page });
};
- const { data, count } = result || {};
- const hasData = !!(data as any)?.length;
- const { page } = params;
-
if (query.isLoading) {
return