pangea-server 3.3.111 → 3.3.113
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.
|
@@ -306,21 +306,29 @@ function getFinalOrder(order, config = {}) {
|
|
|
306
306
|
}
|
|
307
307
|
function processInstance(model, instance) {
|
|
308
308
|
for (const [relName] of Object.entries(model.Relations)) {
|
|
309
|
-
console.log(relName);
|
|
309
|
+
console.log('relName: ', relName);
|
|
310
310
|
const relInstance = instance[relName];
|
|
311
|
+
console.log('relInstance');
|
|
312
|
+
console.dir(relInstance, { depth: 1 });
|
|
311
313
|
if (!relInstance)
|
|
312
314
|
continue;
|
|
313
315
|
const relModel = model.Relations[relName].getModelFn();
|
|
314
316
|
if (Array.isArray(relInstance)) {
|
|
317
|
+
console.log('Array.isArray(relInstance)');
|
|
315
318
|
relInstance.forEach((i) => processInstance(relModel, i));
|
|
316
319
|
}
|
|
317
320
|
else {
|
|
321
|
+
console.log('!!! Array.isArray(relInstance)');
|
|
318
322
|
processInstance(relModel, relInstance);
|
|
319
323
|
}
|
|
320
324
|
}
|
|
321
325
|
console.log(model.name);
|
|
322
326
|
const jsonInstance = instance.toJSON();
|
|
327
|
+
console.log('jsonInstance');
|
|
328
|
+
console.dir(jsonInstance, { depth: 1 });
|
|
323
329
|
model.InitInstance(jsonInstance);
|
|
330
|
+
console.log('model.InitInstance()');
|
|
331
|
+
console.dir(jsonInstance, { depth: 1 });
|
|
324
332
|
return jsonInstance;
|
|
325
333
|
}
|
|
326
334
|
function processInstances(model, instances) {
|