mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
17 lines
383 B
JavaScript
17 lines
383 B
JavaScript
import { prisma, runQuery } from 'lib/db';
|
|
|
|
import { URL_LENGTH } from 'lib/constants';
|
|
|
|
export async function savePageView(website_id, session_id, url, referrer) {
|
|
return runQuery(
|
|
prisma.pageview.create({
|
|
data: {
|
|
website_id,
|
|
session_id,
|
|
url: url?.substr(0, URL_LENGTH),
|
|
referrer: referrer?.substr(0, URL_LENGTH),
|
|
},
|
|
}),
|
|
);
|
|
}
|