mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
0a81a4a728
10 changed files with 129 additions and 57 deletions
|
|
@ -16,6 +16,14 @@ export interface InsightsRequestBody {
|
|||
groups: { name: string; type: string }[];
|
||||
}
|
||||
|
||||
function convertFilters(filters) {
|
||||
return filters.reduce((obj, { name, ...value }) => {
|
||||
obj[name] = value;
|
||||
|
||||
return obj;
|
||||
}, {});
|
||||
}
|
||||
|
||||
export default async (
|
||||
req: NextApiRequestQueryBody<any, InsightsRequestBody>,
|
||||
res: NextApiResponse,
|
||||
|
|
@ -36,7 +44,7 @@ export default async (
|
|||
}
|
||||
|
||||
const data = await getInsights(websiteId, fields, {
|
||||
...filters,
|
||||
...convertFilters(filters),
|
||||
startDate: new Date(startDate),
|
||||
endDate: new Date(endDate),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue