update api to new CH columns

This commit is contained in:
Francis Cao 2022-10-08 16:12:33 -07:00
parent 36edbe2f4c
commit 96add409b6
19 changed files with 74 additions and 48 deletions

View file

@ -60,6 +60,10 @@ function getDateFormat(date) {
return `'${dateFormat(date, 'UTC:yyyy-mm-dd HH:MM:ss')}'`;
}
function getCommaSeparatedStringFormat(data, column) {
return data.map(obj => `'${obj[column]}'`).join(',');
}
function getBetweenDates(field, start_at, end_at) {
return `${field} between ${getDateFormat(start_at)}
and ${getDateFormat(end_at)}`;
@ -180,6 +184,7 @@ export default {
getDateStringQuery,
getDateQuery,
getDateFormat,
getCommaSeparatedStringFormat,
getBetweenDates,
getFilterQuery,
parseFilters,

View file

@ -66,7 +66,7 @@ export async function getSession(req) {
if (!sessionId) {
try {
session = await createSession(websiteId, {
session = await createSession(websiteId, website_uuid, {
session_uuid,
hostname,
browser,
@ -98,6 +98,7 @@ export async function getSession(req) {
return {
website_id: websiteId,
website_uuid: website_uuid,
session,
};
}