mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Breakdown feature for insights report.
This commit is contained in:
parent
5e1111db5d
commit
f48720c915
6 changed files with 51 additions and 46 deletions
|
|
@ -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,24 +27,19 @@ 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,
|
||||
{
|
||||
...filters,
|
||||
startDate: new Date(startDate),
|
||||
endDate: new Date(endDate),
|
||||
},
|
||||
groups,
|
||||
);
|
||||
const data = await getInsights(websiteId, groups, {
|
||||
...filters,
|
||||
startDate: new Date(startDate),
|
||||
endDate: new Date(endDate),
|
||||
});
|
||||
|
||||
return ok(res, data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue