mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
udpate constants and references to filter groups
This commit is contained in:
parent
5ffafc71fc
commit
657ae8ebdb
6 changed files with 39 additions and 22 deletions
|
|
@ -30,17 +30,13 @@ export async function GET(
|
|||
return unauthorized();
|
||||
}
|
||||
|
||||
if (
|
||||
!SESSION_COLUMNS.includes(type) &&
|
||||
!EVENT_COLUMNS.includes(type) &&
|
||||
!FILTER_GROUPS.includes(type)
|
||||
) {
|
||||
if (!SESSION_COLUMNS.includes(type) && !EVENT_COLUMNS.includes(type) && !FILTER_GROUPS[type]) {
|
||||
return badRequest('Invalid type.');
|
||||
}
|
||||
|
||||
let values;
|
||||
|
||||
if (FILTER_GROUPS.includes(type)) {
|
||||
if (FILTER_GROUPS[type]) {
|
||||
values = (await getWebsiteSegments(websiteId, type)).map(segment => ({ value: segment.name }));
|
||||
} else {
|
||||
values = await getValues(websiteId, FILTER_COLUMNS[type], startDate, endDate, search);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue