Fix dashboard call.

This commit is contained in:
Brian Cao 2023-12-03 20:15:02 -08:00
parent 260f03cda4
commit 4d3d784c68

View File

@ -12,9 +12,11 @@ import useDashboard from 'store/dashboard';
import useMessages from 'components/hooks/useMessages'; import useMessages from 'components/hooks/useMessages';
import useLocale from 'components/hooks/useLocale'; import useLocale from 'components/hooks/useLocale';
import useFilterQuery from 'components/hooks/useFilterQuery'; import useFilterQuery from 'components/hooks/useFilterQuery';
import { useUser } from 'components/hooks';
export function Dashboard() { export function Dashboard() {
const { formatMessage, labels, messages } = useMessages(); const { formatMessage, labels, messages } = useMessages();
const { user } = useUser();
const { showCharts, editing } = useDashboard(); const { showCharts, editing } = useDashboard();
const { dir } = useLocale(); const { dir } = useLocale();
const { get } = useApi(); const { get } = useApi();
@ -23,7 +25,7 @@ export function Dashboard() {
const { query, params, setParams, result } = useFilterQuery({ const { query, params, setParams, result } = useFilterQuery({
queryKey: ['dashboard:websites'], queryKey: ['dashboard:websites'],
queryFn: (params: any) => { queryFn: (params: any) => {
return get(`/websites`, { ...params, includeTeams: true, pageSize }); return get(`/users/${user.id}/websites`, { ...params, includeTeams: true, pageSize });
}, },
}); });