Allow filtering same metric via API.

This commit is contained in:
Mike Cao 2023-08-28 20:09:54 -07:00
parent 53eb190f97
commit 401decaa25
2 changed files with 26 additions and 28 deletions

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 },
);