Просмотр исходного кода

fix(dashboard): Pass native arrays from FacetValueInput onChange

The FacetValueInput component was calling JSON.stringify() on array
values before passing them to onChange, causing Zod validation errors
("Expected array, received string") for relation list custom fields.

Fixes #4146
Jan Tokic 23 часов назад
Родитель
Сommit
510ecc2178
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/dashboard/src/lib/components/data-input/facet-value-input.tsx

+ 2 - 2
packages/dashboard/src/lib/components/data-input/facet-value-input.tsx

@@ -38,12 +38,12 @@ export const FacetValueInput: DashboardFormComponent = ({ value, onChange, disab
 
 
     const onValueSelectHandler = (value: FacetValue) => {
     const onValueSelectHandler = (value: FacetValue) => {
         const newIds = new Set([...ids, value.id]);
         const newIds = new Set([...ids, value.id]);
-        onChange(JSON.stringify(Array.from(newIds)));
+        onChange(Array.from(newIds));
     };
     };
 
 
     const onValueRemoveHandler = (id: string) => {
     const onValueRemoveHandler = (id: string) => {
         const newIds = new Set(ids.filter(existingId => existingId !== id));
         const newIds = new Set(ids.filter(existingId => existingId !== id));
-        onChange(JSON.stringify(Array.from(newIds)));
+        onChange(Array.from(newIds));
     };
     };
 
 
     return (
     return (