@sankhyalabs/sankhyablocks 1.1.22 → 1.1.23
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/dist/cjs/snk-application.cjs.entry.js +1197 -1190
- package/dist/collection/lib/http/data-fetcher/fetchers/dataunit-fetcher.js +16 -9
- package/dist/components/snk-application.js +1197 -1190
- package/dist/esm/snk-application.entry.js +1197 -1190
- package/dist/sankhyablocks/{p-fe95f2c4.entry.js → p-f3bdd8c3.entry.js} +1 -1
- package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
- package/dist/types/lib/http/data-fetcher/fetchers/dataunit-fetcher.d.ts +1 -0
- package/package.json +1 -1
|
@@ -123,15 +123,7 @@ export default class DataUnitFetcher {
|
|
|
123
123
|
const changes = duChanges.map((change) => {
|
|
124
124
|
const { dataUnit: changeDU, record, updatingFields, operation } = change;
|
|
125
125
|
const parsedUpdatingFields = Object.entries(updatingFields).map(([fieldName, value]) => {
|
|
126
|
-
|
|
127
|
-
try {
|
|
128
|
-
value = JSON.stringify(value);
|
|
129
|
-
}
|
|
130
|
-
catch (_a) {
|
|
131
|
-
value = value.toString();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
return { fieldName, value };
|
|
126
|
+
return { fieldName, value: this.formatValueToServer(value) };
|
|
135
127
|
});
|
|
136
128
|
return { dataUnit: changeDU, updatingFields: parsedUpdatingFields, operation, recordId: record.__record__id__ };
|
|
137
129
|
});
|
|
@@ -160,6 +152,21 @@ export default class DataUnitFetcher {
|
|
|
160
152
|
});
|
|
161
153
|
});
|
|
162
154
|
}
|
|
155
|
+
formatValueToServer(value) {
|
|
156
|
+
if (value === undefined)
|
|
157
|
+
return value;
|
|
158
|
+
try {
|
|
159
|
+
if (value instanceof Date) {
|
|
160
|
+
return value.toString();
|
|
161
|
+
}
|
|
162
|
+
//Any others objects
|
|
163
|
+
value = JSON.stringify(value);
|
|
164
|
+
}
|
|
165
|
+
catch (_a) {
|
|
166
|
+
value = value.toString();
|
|
167
|
+
}
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
163
170
|
removeRecords(dataUnit, recordIds) {
|
|
164
171
|
const changes = recordIds.map((recordId) => {
|
|
165
172
|
return { dataUnit: dataUnit.name, operation: ChangeOperation.DELETE, recordId };
|