fix(dashboard): filter event names when needed

This commit is contained in:
Carl-Gerhard Lindesvärd
2026-02-05 21:24:54 +00:00
parent 7a88b262c0
commit c978904815

View File

@@ -1,7 +1,10 @@
import { useTRPC } from '@/integrations/trpc/react';
import { useQuery } from '@tanstack/react-query';
export function useEventNames(params: any) {
export function useEventNames(params: {
projectId: string;
anyEvents?: boolean;
}) {
const trpc = useTRPC();
const query = useQuery(
trpc.chart.events.queryOptions(params, {
@@ -9,5 +12,7 @@ export function useEventNames(params: any) {
staleTime: 1000 * 60 * 10,
}),
);
return query.data ?? [];
return (query.data ?? []).filter((event) =>
(params.anyEvents ?? true) ? true : event.name !== '*',
);
}