fix(dashboard): fix event properties combobox

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-09-05 18:13:44 +02:00
parent 92fd302648
commit 07940c7cc5

View File

@@ -1,5 +1,6 @@
import { Combobox } from '@/components/ui/combobox'; import { Combobox } from '@/components/ui/combobox';
import { useAppParams } from '@/hooks/useAppParams'; import { useAppParams } from '@/hooks/useAppParams';
import { useEventProperties } from '@/hooks/useEventProperties';
import { useDispatch, useSelector } from '@/redux'; import { useDispatch, useSelector } from '@/redux';
import { api } from '@/trpc/client'; import { api } from '@/trpc/client';
import { cn } from '@/utils/cn'; import { cn } from '@/utils/cn';
@@ -20,7 +21,7 @@ export function EventPropertiesCombobox({
const { projectId } = useAppParams(); const { projectId } = useAppParams();
const range = useSelector((state) => state.report.range); const range = useSelector((state) => state.report.range);
const interval = useSelector((state) => state.report.interval); const interval = useSelector((state) => state.report.interval);
const query = api.chart.properties.useQuery( const properties = useEventProperties(
{ {
event: event.name, event: event.name,
projectId, projectId,
@@ -30,9 +31,7 @@ export function EventPropertiesCombobox({
{ {
enabled: !!event.name, enabled: !!event.name,
} }
); ).map((item) => ({
const properties = (query.data ?? []).map((item) => ({
label: item, label: item,
value: item, value: item,
})); }));