mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
fix: update WebsiteMetricsData type for new response format
Type now correctly represents both array format (event/pageview metrics)
and { data, total } format (session metrics).
This commit is contained in:
parent
11142d401d
commit
1a04856a8b
1 changed files with 3 additions and 4 deletions
|
|
@ -4,10 +4,9 @@ import { useApi } from '../useApi';
|
||||||
import { useDateParameters } from '../useDateParameters';
|
import { useDateParameters } from '../useDateParameters';
|
||||||
import { useFilterParameters } from '../useFilterParameters';
|
import { useFilterParameters } from '../useFilterParameters';
|
||||||
|
|
||||||
export type WebsiteMetricsData = {
|
export type WebsiteMetricsData =
|
||||||
x: string;
|
| { x: string; y: number }[]
|
||||||
y: number;
|
| { data: { x: string; y: number }[]; total: number };
|
||||||
}[];
|
|
||||||
|
|
||||||
export function useWebsiteMetricsQuery(
|
export function useWebsiteMetricsQuery(
|
||||||
websiteId: string,
|
websiteId: string,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue