better handling dates in clickhouse

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-08-28 10:53:23 +02:00
parent df05e2dab3
commit 2be2ff3e12
14 changed files with 97 additions and 71 deletions

View File

@@ -1,10 +1,8 @@
import { api } from '@/trpc/client';
export function useEventNames(projectId: string, options?: any) {
const query = api.chart.events.useQuery({
projectId: projectId,
...(options ? options : {}),
});
export function useEventNames(
params: Parameters<typeof api.chart.events.useQuery>[0]
) {
const query = api.chart.events.useQuery(params);
return query.data ?? [];
}

View File

@@ -1,10 +1,9 @@
import { api } from '@/trpc/client';
export function useEventProperties(projectId: string, event?: string) {
const query = api.chart.properties.useQuery({
projectId: projectId,
event,
});
export function useEventProperties(
params: Parameters<typeof api.chart.properties.useQuery>[0]
) {
const query = api.chart.properties.useQuery(params);
return query.data ?? [];
}

View File

@@ -1,15 +1,8 @@
import { api } from '@/trpc/client';
export function useEventValues(
projectId: string,
event: string,
property: string
params: Parameters<typeof api.chart.values.useQuery>[0]
) {
const query = api.chart.values.useQuery({
projectId: projectId,
event,
property,
});
const query = api.chart.values.useQuery(params);
return query.data?.values ?? [];
}