Allow filtering same metric via API.

This commit is contained in:
Mike Cao committed 2023-08-28 20:09:54 -07:00
1 parent 53eb190f97
commit 401decaa25
2 files changed
+26 -28

No files matched your search

+9 -12
View File
@@ -54,21 +54,18 @@ export function MetricsTable({
city,
},
],
() =>
get(`/websites/${websiteId}/metrics`, {
() => {
const filters = { url, title, referrer, os, browser, device, country, region, city };
filters[type] = undefined;
return get(`/websites/${websiteId}/metrics`, {
type,
startAt: +startDate,
endAt: +endDate,
url,
title,
referrer,
os,
browser,
device,
country,
region,
city,
}),
...filters,
});
},
{ onSuccess: onDataLoad, retryDelay: delay || DEFAULT_ANIMATION_DURATION },
);