fix(dashboard): filter event names when needed
This commit is contained in:
@@ -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 !== '*',
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user