pangea-server 1.0.18 → 1.0.20
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,9 +206,12 @@ 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(`----- relKey: ${relKey} -----`);
|
|
211
213
|
const currentDepth = relDepth.get(relKey) || 0;
|
|
214
|
+
console.log(`----- currentDepth: ${currentDepth} -----`);
|
|
212
215
|
const maxDepth = rel.joinDepth;
|
|
213
216
|
if (currentDepth >= maxDepth)
|
|
214
217
|
continue;
|
|
@@ -220,11 +223,13 @@ function getIncludeAndWhere(model, includeItems, where, relDepth = new Map(), pa
|
|
|
220
223
|
const newRelDepth = new Map(relDepth);
|
|
221
224
|
newRelDepth.set(relKey, currentDepth + 1);
|
|
222
225
|
const relModel = rel.getModelFn();
|
|
226
|
+
console.log(`----- relModel: ${relModel.name} -----`);
|
|
223
227
|
includeOptions.push({
|
|
224
228
|
model: relModel,
|
|
225
229
|
as: relName,
|
|
226
230
|
required: rel.required,
|
|
227
231
|
paranoid: rel.paranoid,
|
|
232
|
+
subQuery: false,
|
|
228
233
|
...getIncludeAndWhere(relModel, nestedIncludeItems, relWhere, newRelDepth, relKey),
|
|
229
234
|
});
|
|
230
235
|
}
|