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

@ -17,14 +17,16 @@ export default function EventsChart({ websiteId, token }) {
const { data } = useFetch(
`/api/website/${websiteId}/events`,
{
start_at: +startDate,
end_at: +endDate,
unit,
tz: timezone,
url: query.url,
token,
params: {
start_at: +startDate,
end_at: +endDate,
unit,
tz: timezone,
url: query.url,
token,
},
},
{ update: [modified] },
[modified],
);
const datasets = useMemo(() => {
if (!data) return [];