mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 04:55:36 +01:00
Finish event_data relational.
This commit is contained in:
parent
f1f602b42d
commit
2343949d3e
12 changed files with 133 additions and 122 deletions
|
|
@ -40,11 +40,13 @@ async function relationalQuery(data: {
|
|||
eventName?: string;
|
||||
eventData?: any;
|
||||
}) {
|
||||
const { websiteId, id: sessionId, urlPath, urlQuery, eventName, pageTitle } = data;
|
||||
const { websiteId, id: sessionId, urlPath, urlQuery, eventName, eventData, pageTitle } = data;
|
||||
const website = await cache.fetchWebsite(websiteId);
|
||||
const websiteEventId = uuid();
|
||||
|
||||
return prisma.client.websiteEvent.create({
|
||||
const websiteEvent = prisma.client.websiteEvent.create({
|
||||
data: {
|
||||
id: uuid(),
|
||||
id: websiteEventId,
|
||||
websiteId,
|
||||
sessionId,
|
||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||
|
|
@ -54,6 +56,20 @@ async function relationalQuery(data: {
|
|||
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
||||
},
|
||||
});
|
||||
|
||||
if (eventData) {
|
||||
await saveEventData({
|
||||
websiteId,
|
||||
sessionId,
|
||||
eventId: websiteEventId,
|
||||
revId: website?.revId,
|
||||
urlPath: urlPath?.substring(0, URL_LENGTH),
|
||||
eventName: eventName?.substring(0, EVENT_NAME_LENGTH),
|
||||
eventData,
|
||||
});
|
||||
}
|
||||
|
||||
return websiteEvent;
|
||||
}
|
||||
|
||||
async function clickhouseQuery(data: {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue