pangea-server 1.0.23 → 1.0.25
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.
|
@@ -206,8 +206,10 @@ function convertWhereKeys(obj) {
|
|
|
206
206
|
function getIncludeAndWhere(model, includeItems, where, relDepth = new Map(), parentKey = model.name) {
|
|
207
207
|
const includeOptions = [];
|
|
208
208
|
const cleanWhere = { ...where };
|
|
209
|
+
console.log(`----- Model: ${model.name} -----`);
|
|
209
210
|
for (const [relName, rel] of Object.entries(model.Relations)) {
|
|
210
211
|
const relKey = `${parentKey}->${relName}`;
|
|
212
|
+
console.log(`----- Model: ${relKey} -----`);
|
|
211
213
|
const currentDepth = relDepth.get(relKey) || 0;
|
|
212
214
|
const maxDepth = rel.joinDepth;
|
|
213
215
|
if (currentDepth >= maxDepth)
|
|
@@ -220,6 +222,7 @@ function getIncludeAndWhere(model, includeItems, where, relDepth = new Map(), pa
|
|
|
220
222
|
const newRelDepth = new Map(relDepth);
|
|
221
223
|
newRelDepth.set(relKey, currentDepth + 1);
|
|
222
224
|
const relModel = rel.getModelFn();
|
|
225
|
+
console.log(`----- relModel: ${relModel.name} -----`);
|
|
223
226
|
includeOptions.push({
|
|
224
227
|
model: relModel,
|
|
225
228
|
as: relName,
|