fix(dashboard): fix event properties combobox
This commit is contained in:
@@ -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,
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user