mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
move queries
This commit is contained in:
parent
910f165103
commit
8aec6d7406
53 changed files with 920 additions and 485 deletions
17
queries/analytics/event/saveEvent.js
Normal file
17
queries/analytics/event/saveEvent.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import { runQuery } from 'queries';
|
||||
import prisma from 'lib/db';
|
||||
import { URL_LENGTH } from 'lib/constants';
|
||||
|
||||
export async function saveEvent(website_id, session_id, url, event_type, event_value) {
|
||||
return runQuery(
|
||||
prisma.event.create({
|
||||
data: {
|
||||
website_id,
|
||||
session_id,
|
||||
url: url?.substr(0, URL_LENGTH),
|
||||
event_type: event_type?.substr(0, 50),
|
||||
event_value: event_value?.substr(0, 50),
|
||||
},
|
||||
}),
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue