@visns-studio/visns-components 3.4.1 → 3.4.2

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.
@@ -621,7 +621,31 @@ function Form({
621
621
  }
622
622
  }
623
623
 
624
- const res = await CustomFetch(url, method, formData);
624
+ const fieldMap = formSettings.fields.reduce((acc, field) => {
625
+ acc[field.id] = field;
626
+ return acc;
627
+ }, {});
628
+
629
+ let payload = { ...formData };
630
+
631
+ Object.keys(formData).forEach((key) => {
632
+ const value = formData[key];
633
+ const field = fieldMap[key];
634
+
635
+ // Check if the field exists and is of type 'multi-dropdown-ajax'
636
+ if (field && field.type === 'multi-dropdown-ajax') {
637
+ // Check if 'value' and 'label' exist
638
+ if (value && 'value' in value && 'label' in value) {
639
+ console.info(
640
+ `Updating payload for key ${key}:`,
641
+ value
642
+ );
643
+ payload[key] = value.value;
644
+ }
645
+ }
646
+ });
647
+
648
+ const res = await CustomFetch(url, method, payload);
625
649
 
626
650
  if (res.data.error === '') {
627
651
  if (fetchTable) {
package/package.json CHANGED
@@ -49,7 +49,7 @@
49
49
  "react-dom": "^17.0.1"
50
50
  },
51
51
  "name": "@visns-studio/visns-components",
52
- "version": "3.4.1",
52
+ "version": "3.4.2",
53
53
  "description": "Various packages to assist in the development of our Custom Applications.",
54
54
  "main": "index.js",
55
55
  "scripts": {