better handling dates in clickhouse
This commit is contained in:
@@ -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 ?? [];
|
||||
}
|
||||
|
||||
@@ -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 ?? [];
|
||||
}
|
||||
|
||||
@@ -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 ?? [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user