Updated fetch hook API.

This commit is contained in:
Mike Cao 2020-10-09 12:39:03 -07:00
commit 69b317386a
21 changed files with 112 additions and 76 deletions

View file

@ -35,14 +35,17 @@ export default function WebsiteChart({
const { data, loading, error } = useFetch(
`/api/website/${websiteId}/pageviews`,
{
start_at: +startDate,
end_at: +endDate,
unit,
tz: timezone,
url,
token,
params: {
start_at: +startDate,
end_at: +endDate,
unit,
tz: timezone,
url,
token,
},
onDataLoad,
},
{ onDataLoad, update: [modified] },
[modified],
);
const chartData = useMemo(() => {