mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 11:35:37 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -12,12 +12,12 @@ export function WebsiteChart({ websiteId }) {
|
|||
} = useNavigation();
|
||||
const { get, useQuery } = useApi();
|
||||
|
||||
const { data, isLoading } = useQuery(
|
||||
[
|
||||
const { data, isLoading } = useQuery({
|
||||
queryKey: [
|
||||
'websites:pageviews',
|
||||
{ websiteId, modified, url, referrer, os, browser, device, country, region, city, title },
|
||||
],
|
||||
() =>
|
||||
queryFn: () =>
|
||||
get(`/websites/${websiteId}/pageviews`, {
|
||||
startAt: +startDate,
|
||||
endAt: +endDate,
|
||||
|
|
@ -33,7 +33,7 @@ export function WebsiteChart({ websiteId }) {
|
|||
city,
|
||||
title,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
const chartData = useMemo(() => {
|
||||
if (data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue