mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 21:57:16 +01:00
Added comparison tables.
This commit is contained in:
parent
626fe14fc2
commit
b7a7d4de4d
18 changed files with 220 additions and 168 deletions
|
|
@ -4,7 +4,7 @@ import { useFilterParams } from '../useFilterParams';
|
|||
|
||||
export function useWebsiteMetrics(
|
||||
websiteId: string,
|
||||
query: { type: string; limit: number; search: string },
|
||||
queryParams: { type: string; limit: number; search: string; startAt?: number; endAt?: number },
|
||||
options?: Omit<UseQueryOptions & { onDataLoad?: (data: any) => void }, 'queryKey' | 'queryFn'>,
|
||||
) {
|
||||
const { get, useQuery } = useApi();
|
||||
|
|
@ -16,17 +16,17 @@ export function useWebsiteMetrics(
|
|||
{
|
||||
websiteId,
|
||||
...params,
|
||||
...query,
|
||||
...queryParams,
|
||||
},
|
||||
],
|
||||
queryFn: async () => {
|
||||
const filters = { ...params };
|
||||
|
||||
filters[query.type] = undefined;
|
||||
filters[queryParams.type] = undefined;
|
||||
|
||||
const data = await get(`/websites/${websiteId}/metrics`, {
|
||||
...filters,
|
||||
...query,
|
||||
...queryParams,
|
||||
});
|
||||
|
||||
options?.onDataLoad?.(data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue