mirror of
https://github.com/umami-software/umami.git
synced 2026-02-06 13:47:15 +01:00
Fixed retention report showing wrong dates. Changed Breakdown field select to modal.
This commit is contained in:
parent
ee8750d9df
commit
ea83afbc13
20 changed files with 108 additions and 277 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { useApi } from '@/components/hooks';
|
||||
import { useApi } from '../useApi';
|
||||
import { useFilterParams } from '../useFilterParams';
|
||||
import { ReactQueryOptions } from '@/lib/types';
|
||||
|
||||
export function useResultQuery<T>(
|
||||
|
|
@ -6,11 +7,21 @@ export function useResultQuery<T>(
|
|||
params?: { [key: string]: any },
|
||||
options?: ReactQueryOptions<T>,
|
||||
) {
|
||||
const { websiteId } = params;
|
||||
const { post, useQuery } = useApi();
|
||||
const filterParams = useFilterParams(websiteId);
|
||||
|
||||
return useQuery<T>({
|
||||
queryKey: ['reports', type, params],
|
||||
queryFn: () => post(`/reports/${type}`, { type, ...params }),
|
||||
queryKey: [
|
||||
'reports',
|
||||
{
|
||||
type,
|
||||
websiteId,
|
||||
...filterParams,
|
||||
...params,
|
||||
},
|
||||
],
|
||||
queryFn: () => post(`/reports/${type}`, { type, ...filterParams, ...params }),
|
||||
enabled: !!type,
|
||||
...options,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue