Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Mike Cao 2023-04-13 22:44:49 -07:00
commit 2890cb4419
2 changed files with 32 additions and 2 deletions

View File

@ -137,7 +137,7 @@ async function clickhouseQuery(data: {
session_id: sessionId, session_id: sessionId,
event_id: eventId, event_id: eventId,
country: country ? country : null, country: country ? country : null,
subdivision1: subdivision1 ? subdivision1 : null, subdivision1: subdivision1 ? country.concat('-', subdivision1) : null,
subdivision2: subdivision2 ? subdivision2 : null, subdivision2: subdivision2 ? subdivision2 : null,
city: city ? city : null, city: city ? city : null,
url_path: urlPath?.substring(0, URL_LENGTH), url_path: urlPath?.substring(0, URL_LENGTH),

View File

@ -18,7 +18,37 @@ export async function createSession(args: Prisma.SessionCreateInput) {
} }
async function relationalQuery(data: Prisma.SessionCreateInput) { async function relationalQuery(data: Prisma.SessionCreateInput) {
return prisma.client.session.create({ data }); const {
id,
websiteId,
hostname,
browser,
os,
device,
screen,
language,
country,
subdivision1,
subdivision2,
city,
} = data;
return prisma.client.session.create({
data: {
id,
websiteId,
hostname,
browser,
os,
device,
screen,
language,
country,
subdivision1: country.concat('-', subdivision1),
subdivision2,
city,
},
});
} }
async function clickhouseQuery(data: { async function clickhouseQuery(data: {