diff --git a/react/src/__rust_generated__/EmbedFilters.ts b/react/src/__rust_generated__/EmbedFilters.ts index e52af4e..207a5e9 100644 --- a/react/src/__rust_generated__/EmbedFilters.ts +++ b/react/src/__rust_generated__/EmbedFilters.ts @@ -1,9 +1,11 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { FilterConfig } from './FilterConfig'; import type { FilterVariableValue } from './FilterVariableValue'; +import type { LabelValue } from './LabelValue'; export interface EmbedFilters { filters: Array; defaultValues: Record; - uniqueValues: Record>; + // uniqueValues: Record>; + uniqueValuesV2: Record>; } diff --git a/react/src/__rust_generated__/LabelValue.ts b/react/src/__rust_generated__/LabelValue.ts new file mode 100644 index 0000000..1b3c48b --- /dev/null +++ b/react/src/__rust_generated__/LabelValue.ts @@ -0,0 +1,6 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export interface LabelValue { + label: string; + value: string; +} diff --git a/react/src/filter/Filter.tsx b/react/src/filter/Filter.tsx index 3487046..69e0358 100644 --- a/react/src/filter/Filter.tsx +++ b/react/src/filter/Filter.tsx @@ -18,13 +18,12 @@ const Filter = ({ canvasData, filter }: { canvasData: EmbedResponse; filter: Fil if (filterOptionsCache) { return filterOptionsCache; } - const uniqueValues = canvasData.filters.uniqueValues[storeId]; + const uniqueValues = canvasData.filters.uniqueValuesV2[storeId]; if (!uniqueValues) { return []; } - const options = uniqueValues.map((option) => ({ label: option[0], value: option[1] })); - setFilterOptionsCache(options); - return options; + setFilterOptionsCache(uniqueValues); + return uniqueValues; }; const filterOptions = getFilterOptions(); return (