mirror of
https://github.com/umami-software/umami.git
synced 2026-02-18 03:25:40 +01:00
Refactored useQuery functions.
This commit is contained in:
parent
be550cc440
commit
b578162cb6
33 changed files with 179 additions and 151 deletions
|
|
@ -11,15 +11,15 @@ export function EventDataMetricsBar({ websiteId }) {
|
|||
const [dateRange] = useDateRange(websiteId);
|
||||
const { startDate, endDate, modified } = dateRange;
|
||||
|
||||
const { data, error, isLoading, isFetched } = useQuery(
|
||||
['event-data:stats', { websiteId, startDate, endDate, modified }],
|
||||
() =>
|
||||
const { data, error, isLoading, isFetched } = useQuery({
|
||||
queryKey: ['event-data:stats', { websiteId, startDate, endDate, modified }],
|
||||
queryFn: () =>
|
||||
get(`/event-data/stats`, {
|
||||
websiteId,
|
||||
startAt: +startDate,
|
||||
endAt: +endDate,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
return (
|
||||
<div className={styles.container}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue