@visns-studio/visns-components 3.7.3 → 3.7.4
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 +22 -3
- package/package.json +1 -1
package/components/crm/Form.jsx
CHANGED
|
@@ -630,15 +630,19 @@ function Form({
|
|
|
630
630
|
}, {});
|
|
631
631
|
|
|
632
632
|
let payload = { ...formData };
|
|
633
|
-
|
|
634
633
|
Object.keys(formData).forEach((key) => {
|
|
635
634
|
const value = formData[key];
|
|
636
635
|
const field = fieldMap[key];
|
|
637
636
|
|
|
638
637
|
// Check if the field exists and is of type 'multi-dropdown-ajax'
|
|
639
638
|
if (field && field.type === 'multi-dropdown-ajax') {
|
|
640
|
-
//
|
|
641
|
-
if (
|
|
639
|
+
// First check if 'value' is an object and then check if 'value' and 'label' exist in it
|
|
640
|
+
if (
|
|
641
|
+
typeof value === 'object' &&
|
|
642
|
+
value !== null &&
|
|
643
|
+
'value' in value &&
|
|
644
|
+
'label' in value
|
|
645
|
+
) {
|
|
642
646
|
console.info(
|
|
643
647
|
`Updating payload for key ${key}:`,
|
|
644
648
|
value
|
|
@@ -1055,6 +1059,13 @@ function Form({
|
|
|
1055
1059
|
) {
|
|
1056
1060
|
return null;
|
|
1057
1061
|
}
|
|
1062
|
+
if (
|
|
1063
|
+
item.hasOwnProperty('updateOnly') &&
|
|
1064
|
+
item.updateOnly === true &&
|
|
1065
|
+
formType === 'create'
|
|
1066
|
+
) {
|
|
1067
|
+
return null;
|
|
1068
|
+
}
|
|
1058
1069
|
|
|
1059
1070
|
switch (item.type) {
|
|
1060
1071
|
case 'table':
|
|
@@ -1195,6 +1206,14 @@ function Form({
|
|
|
1195
1206
|
) {
|
|
1196
1207
|
return null;
|
|
1197
1208
|
}
|
|
1209
|
+
if (
|
|
1210
|
+
item.hasOwnProperty('updateOnly') &&
|
|
1211
|
+
item.updateOnly === true &&
|
|
1212
|
+
formType === 'create'
|
|
1213
|
+
) {
|
|
1214
|
+
return null;
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1198
1217
|
return (
|
|
1199
1218
|
<Field
|
|
1200
1219
|
api={api}
|
package/package.json
CHANGED