@visns-studio/visns-components 2.8.7 → 2.8.9
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 +16 -1
- package/package.json +1 -1
package/components/crm/Form.jsx
CHANGED
|
@@ -707,6 +707,21 @@ 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
|
+
|
|
718
|
+
for (let key of keys) {
|
|
719
|
+
value = value[key];
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// Update the updatedFormData object
|
|
723
|
+
updatedFormData[item] = value;
|
|
724
|
+
}
|
|
710
725
|
} else {
|
|
711
726
|
if (
|
|
712
727
|
field &&
|
|
@@ -805,7 +820,7 @@ function Form({
|
|
|
805
820
|
};
|
|
806
821
|
|
|
807
822
|
fetchData();
|
|
808
|
-
}, []);
|
|
823
|
+
}, [formSettings]);
|
|
809
824
|
|
|
810
825
|
useEffect(() => {
|
|
811
826
|
formSettings.fields.forEach((field) => {
|
package/package.json
CHANGED