Fix boolean event data.

This commit is contained in:
Brian Cao 2023-04-30 22:55:54 -07:00
parent dcb9f69c43
commit 65ebb26a70
3 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,8 @@ export function TestConsole() {
window.umami.track('track-event-with-data', {
data: {
test: 'test-data',
boolean: true,
booleanError: 'true',
time: new Date(),
number: 1,
time2: new Date().toISOString(),

View File

@ -49,6 +49,7 @@ function createKey(key, value, acc: { keyValues: any[]; parentKey: string }) {
break;
case 'boolean':
eventDataType = EVENT_DATA_TYPE.boolean;
value = value ? 'true' : 'false';
break;
case 'date':
eventDataType = EVENT_DATA_TYPE.date;

View File

@ -1,7 +1,6 @@
import prisma from 'lib/prisma';
import clickhouse from 'lib/clickhouse';
import { runQuery, CLICKHOUSE, PRISMA } from 'lib/db';
import { EVENT_TYPE } from 'lib/constants';
import { CLICKHOUSE, PRISMA, runQuery } from 'lib/db';
import prisma from 'lib/prisma';
export function getEvents(...args: [websiteId: string, startAt: Date, eventType: number]) {
return runQuery({