mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Updated filter params logic. Added inline compare dates.
This commit is contained in:
parent
bfdd3f9525
commit
e79f4717e7
17 changed files with 1128 additions and 1057 deletions
|
|
@ -9,7 +9,7 @@ export function useWebsiteMetricsQuery(
|
|||
options?: Omit<UseQueryOptions & { onDataLoad?: (data: any) => void }, 'queryKey' | 'queryFn'>,
|
||||
) {
|
||||
const { get, useQuery } = useApi();
|
||||
const params = useFilterParams(websiteId);
|
||||
const filterParams = useFilterParams(websiteId);
|
||||
const searchParams = useSearchParams();
|
||||
|
||||
return useQuery({
|
||||
|
|
@ -17,13 +17,13 @@ export function useWebsiteMetricsQuery(
|
|||
'websites:metrics',
|
||||
{
|
||||
websiteId,
|
||||
...params,
|
||||
...filterParams,
|
||||
...queryParams,
|
||||
},
|
||||
],
|
||||
queryFn: async () => {
|
||||
const data = await get(`/websites/${websiteId}/metrics`, {
|
||||
...params,
|
||||
...filterParams,
|
||||
[searchParams.get('view')]: undefined,
|
||||
...queryParams,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ export function useFilters() {
|
|||
let value = safeDecodeURIComponent(query[key]);
|
||||
const label = fields.find(({ name }) => name === key)?.label;
|
||||
|
||||
const match = value.match(/^([a-z]+)~(.*)/);
|
||||
const match = value.match(/^([a-z]+)\.(.*)/);
|
||||
|
||||
if (match) {
|
||||
operator = match[1];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue