fuse-importer 0.23.6 → 0.23.7
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.
|
@@ -74,6 +74,15 @@ var validations = (_a = {},
|
|
|
74
74
|
_a[FieldTypes.time] = validateDatePattern,
|
|
75
75
|
_a[FieldTypes.datetime] = validateDatePattern,
|
|
76
76
|
_a);
|
|
77
|
+
var ignoreNullOrUndefinedKeyValues = function (obj) {
|
|
78
|
+
var result = {};
|
|
79
|
+
Object.keys(obj || {})
|
|
80
|
+
.filter(function (key) { return obj[key] !== null && obj[key] !== undefined; })
|
|
81
|
+
.forEach(function (key) {
|
|
82
|
+
result[key] = obj[key];
|
|
83
|
+
});
|
|
84
|
+
return result;
|
|
85
|
+
};
|
|
77
86
|
export var getRecordErrors = function (_a) {
|
|
78
87
|
var record = _a.record, fields = _a.fields, batchValidationErrors = _a.batchValidationErrors, submittedData = _a.submittedData;
|
|
79
88
|
var submittedRecord = submittedData === null || submittedData === void 0 ? void 0 : submittedData.find(function (r) { return r._meta.id === record._meta.id; });
|
|
@@ -108,8 +117,7 @@ export var getRecordErrors = function (_a) {
|
|
|
108
117
|
return newErrors;
|
|
109
118
|
}, {});
|
|
110
119
|
}
|
|
111
|
-
|
|
112
|
-
return recordErrors;
|
|
120
|
+
return __assign(__assign(__assign({}, ignoreNullOrUndefinedKeyValues(recordValidationErrors)), ignoreNullOrUndefinedKeyValues(recordTemplateValidationErrors)), ignoreNullOrUndefinedKeyValues(appValidationErrors));
|
|
113
121
|
}
|
|
114
122
|
return {};
|
|
115
123
|
};
|