@lobb-js/studio 0.2.11 → 0.2.12
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.
|
@@ -68,7 +68,7 @@ export function generateTransactionBody(collectionName, entry) {
|
|
|
68
68
|
function handleEntryRecursive(transactionBody, collectionName, entry, parentTransactionIndex) {
|
|
69
69
|
var _a;
|
|
70
70
|
var _b;
|
|
71
|
-
var parentCollectionName = parentTransactionIndex !== undefined ? transactionBody[parentTransactionIndex].
|
|
71
|
+
var parentCollectionName = parentTransactionIndex !== undefined ? transactionBody[parentTransactionIndex].collectionName : null;
|
|
72
72
|
var foreignKeyFieldName = (_b = ctx.meta.relations.find(function (relation) { return relation.from.collection === collectionName && relation.to.collection === parentCollectionName; })) === null || _b === void 0 ? void 0 : _b.from.field;
|
|
73
73
|
var collectionFieldNames = Object.keys(ctx.meta.collections[collectionName].fields);
|
|
74
74
|
var payload = {};
|
|
@@ -87,21 +87,19 @@ export function generateTransactionBody(collectionName, entry) {
|
|
|
87
87
|
_a[foreignKeyFieldName] = payload[foreignKeyFieldName],
|
|
88
88
|
_a);
|
|
89
89
|
transactionBody.push({
|
|
90
|
-
|
|
90
|
+
collectionName: collectionName,
|
|
91
91
|
method: "updateMany",
|
|
92
|
-
|
|
93
|
-
localPayload,
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
],
|
|
92
|
+
props: {
|
|
93
|
+
data: localPayload,
|
|
94
|
+
filter: { id: payload.id },
|
|
95
|
+
},
|
|
98
96
|
});
|
|
99
97
|
}
|
|
100
98
|
else {
|
|
101
99
|
transactionBody.push({
|
|
102
|
-
|
|
100
|
+
collectionName: collectionName,
|
|
103
101
|
method: "createOne",
|
|
104
|
-
|
|
102
|
+
props: { data: payload },
|
|
105
103
|
});
|
|
106
104
|
}
|
|
107
105
|
var childrenRelations = ctx.meta.relations.filter(function (relation) { return relation.to.collection === collectionName; });
|