Преглед изворни кода

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 пре 19 часа
родитељ
комит
510ecc2178

+ 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 newIds = new Set([...ids, value.id]);
-        onChange(JSON.stringify(Array.from(newIds)));
+        onChange(Array.from(newIds));
     };
 
     const onValueRemoveHandler = (id: string) => {
         const newIds = new Set(ids.filter(existingId => existingId !== id));
-        onChange(JSON.stringify(Array.from(newIds)));
+        onChange(Array.from(newIds));
     };
 
     return (