Merge branch 'dev' of https://github.com/umami-software/umami into feat/um-376-retention-report

This commit is contained in:
Francis Cao 2023-08-07 14:04:05 -07:00
commit fc5a1f458b
23 changed files with 156 additions and 168 deletions

View file

@ -13,7 +13,7 @@ export interface InsightsRequestBody {
};
fields: { name: string; type: string; value: string }[];
filters: string[];
groups: string[];
groups: { name: string; type: string }[];
}
export default async (
@ -27,21 +27,18 @@ export default async (
const {
websiteId,
dateRange: { startDate, endDate },
fields,
filters,
groups,
filters,
} = req.body;
if (!(await canViewWebsite(req.auth, websiteId))) {
return unauthorized(res);
}
const data = await getInsights(websiteId, {
const data = await getInsights(websiteId, groups, {
...filters,
startDate: new Date(startDate),
endDate: new Date(endDate),
fields,
filters,
groups,
});
return ok(res, data);