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:
Dan Kotov 2026-01-11 16:41:55 -05:00
parent 11142d401d
commit 1a04856a8b

View file

@ -4,10 +4,9 @@ import { useApi } from '../useApi';
import { useDateParameters } from '../useDateParameters';
import { useFilterParameters } from '../useFilterParameters';
export type WebsiteMetricsData = {
x: string;
y: number;
}[];
export type WebsiteMetricsData =
| { x: string; y: number }[]
| { data: { x: string; y: number }[]; total: number };
export function useWebsiteMetricsQuery(
websiteId: string,