diff --git a/package.json b/package.json index d68af5a63d..d5a090dfd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "umami", - "version": "2.11.3", + "version": "2.12.0", "description": "A simple, fast, privacy-focused alternative to Google Analytics.", "author": "Umami Software, Inc. ", "license": "MIT", diff --git a/src/components/hooks/queries/useWebsiteMetrics.ts b/src/components/hooks/queries/useWebsiteMetrics.ts index 301b2e04c0..dd201155b4 100644 --- a/src/components/hooks/queries/useWebsiteMetrics.ts +++ b/src/components/hooks/queries/useWebsiteMetrics.ts @@ -4,8 +4,7 @@ import { useFilterParams } from '../useFilterParams'; export function useWebsiteMetrics( websiteId: string, - type: string, - limit: number, + query: { type: string; limit: number; search: string }, options?: Omit void }, 'queryKey' | 'queryFn'>, ) { const { get, useQuery } = useApi(); @@ -17,19 +16,17 @@ export function useWebsiteMetrics( { websiteId, ...params, - type, - limit, + ...query, }, ], queryFn: async () => { const filters = { ...params }; - filters[type] = undefined; + filters[query.type] = undefined; const data = await get(`/websites/${websiteId}/metrics`, { ...filters, - type, - limit, + ...query, }); options?.onDataLoad?.(data); diff --git a/src/components/metrics/MetricsTable.tsx b/src/components/metrics/MetricsTable.tsx index cfabdd3056..857c136b29 100644 --- a/src/components/metrics/MetricsTable.tsx +++ b/src/components/metrics/MetricsTable.tsx @@ -48,10 +48,14 @@ export function MetricsTable({ const { formatMessage, labels } = useMessages(); const { dir } = useLocale(); - const { data, isLoading, isFetched, error } = useWebsiteMetrics(websiteId, type, limit, { - retryDelay: delay || DEFAULT_ANIMATION_DURATION, - onDataLoad, - }); + const { data, isLoading, isFetched, error } = useWebsiteMetrics( + websiteId, + { type, limit, search }, + { + retryDelay: delay || DEFAULT_ANIMATION_DURATION, + onDataLoad, + }, + ); const filteredData = useMemo(() => { if (data) {