mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Updated event handling.
This commit is contained in:
parent
9f3acd1583
commit
9cb08956c0
7 changed files with 19 additions and 41 deletions
|
|
@ -5,6 +5,7 @@ const prisma = new PrismaClient();
|
|||
export async function runQuery(query) {
|
||||
return query
|
||||
.catch(e => {
|
||||
console.error(e);
|
||||
throw e;
|
||||
})
|
||||
.finally(async () => {
|
||||
|
|
@ -69,9 +70,9 @@ export async function savePageView(website_id, session_id, url, referrer) {
|
|||
);
|
||||
}
|
||||
|
||||
export async function saveEvent(website_id, session_id, url, eventType, eventValue) {
|
||||
export async function saveEvent(website_id, session_id, url, event_type, event_value) {
|
||||
return runQuery(
|
||||
prisma.pageview.create({
|
||||
prisma.event.create({
|
||||
data: {
|
||||
website: {
|
||||
connect: {
|
||||
|
|
@ -84,8 +85,8 @@ export async function saveEvent(website_id, session_id, url, eventType, eventVal
|
|||
},
|
||||
},
|
||||
url,
|
||||
eventType,
|
||||
eventValue,
|
||||
event_type,
|
||||
event_value,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue