mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Compare commits
6 commits
0ddec97bf0
...
dcc1ae1864
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dcc1ae1864 | ||
|
|
5a44e6deb2 | ||
|
|
67e1af7e55 | ||
|
|
2b34cbeb37 | ||
|
|
aaa1f9dc58 | ||
|
|
24b017cad8 |
2 changed files with 16 additions and 3 deletions
|
|
@ -18,7 +18,20 @@ export async function POST(request: Request) {
|
||||||
|
|
||||||
let index = 0;
|
let index = 0;
|
||||||
for (const data of body) {
|
for (const data of body) {
|
||||||
const newRequest = new Request(request, { body: JSON.stringify(data) });
|
// Recreate a fresh Request since `new Request(request)` will have the following error:
|
||||||
|
// > Cannot read private member #state from an object whose class did not declare it
|
||||||
|
|
||||||
|
// Copy headers we received, ensure JSON content type, and avoid conflicting content-length
|
||||||
|
const headers = new Headers(request.headers);
|
||||||
|
headers.set('content-type', 'application/json');
|
||||||
|
headers.delete('content-length');
|
||||||
|
|
||||||
|
const newRequest = new Request(request.url, {
|
||||||
|
method: 'POST',
|
||||||
|
headers,
|
||||||
|
body: JSON.stringify(data),
|
||||||
|
});
|
||||||
|
|
||||||
const response = await send.POST(newRequest);
|
const response = await send.POST(newRequest);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ async function relationalQuery(
|
||||||
sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime"
|
sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime"
|
||||||
from (
|
from (
|
||||||
select
|
select
|
||||||
${column} name,
|
${column} as name,
|
||||||
website_event.session_id,
|
website_event.session_id,
|
||||||
website_event.visit_id,
|
website_event.visit_id,
|
||||||
count(*) as "c",
|
count(*) as "c",
|
||||||
|
|
@ -101,7 +101,7 @@ async function relationalQuery(
|
||||||
and website_event.event_type != 2
|
and website_event.event_type != 2
|
||||||
${excludeDomain}
|
${excludeDomain}
|
||||||
${filterQuery}
|
${filterQuery}
|
||||||
group by name, website_event.session_id, website_event.visit_id
|
group by ${column}, website_event.session_id, website_event.visit_id
|
||||||
) as t
|
) as t
|
||||||
where name != ''
|
where name != ''
|
||||||
group by name
|
group by name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue