@visns-studio/visns-components 2.8.7 → 2.8.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/crm/Form.jsx +17 -1
- package/package.json +1 -1
package/components/crm/Form.jsx
CHANGED
|
@@ -707,6 +707,22 @@ function Form({
|
|
|
707
707
|
|
|
708
708
|
updatedFormData[field.id] = tempRes;
|
|
709
709
|
}
|
|
710
|
+
|
|
711
|
+
if (item.includes('.')) {
|
|
712
|
+
// Split the item string by the dot
|
|
713
|
+
let keys = item.split('.');
|
|
714
|
+
|
|
715
|
+
// Access the nested property
|
|
716
|
+
let value = data;
|
|
717
|
+
console.info(keys, value);
|
|
718
|
+
|
|
719
|
+
for (let key of keys) {
|
|
720
|
+
value = value[key];
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Update the updatedFormData object
|
|
724
|
+
updatedFormData[item] = value;
|
|
725
|
+
}
|
|
710
726
|
} else {
|
|
711
727
|
if (
|
|
712
728
|
field &&
|
|
@@ -805,7 +821,7 @@ function Form({
|
|
|
805
821
|
};
|
|
806
822
|
|
|
807
823
|
fetchData();
|
|
808
|
-
}, []);
|
|
824
|
+
}, [formSettings]);
|
|
809
825
|
|
|
810
826
|
useEffect(() => {
|
|
811
827
|
formSettings.fields.forEach((field) => {
|
package/package.json
CHANGED