@loomcore/api 0.0.58 → 0.0.59
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.
|
@@ -20,18 +20,13 @@ export class MultiTenantApiService extends GenericApiService {
|
|
|
20
20
|
return this.tenantDecorator.applyTenantToQuery(userContext, query, this.pluralResourceName);
|
|
21
21
|
}
|
|
22
22
|
prepareQueryOptions(userContext, queryOptions) {
|
|
23
|
-
console.log('--- MultiTenantApiService.prepareQueryOptions ---');
|
|
24
|
-
console.log('Initial queryOptions.filters:', JSON.stringify(queryOptions.filters, null, 2));
|
|
25
23
|
if (!config?.app?.isMultiTenant) {
|
|
26
24
|
return super.prepareQueryOptions(userContext, queryOptions);
|
|
27
25
|
}
|
|
28
26
|
if (!userContext || !userContext._orgId) {
|
|
29
27
|
throw new BadRequestError('A valid userContext was not provided to MultiTenantApiService.prepareQueryOptions');
|
|
30
28
|
}
|
|
31
|
-
|
|
32
|
-
console.log('Final queryOptions.filters:', JSON.stringify(newQueryOptions.filters, null, 2));
|
|
33
|
-
console.log('-------------------------------------------------');
|
|
34
|
-
return newQueryOptions;
|
|
29
|
+
return this.tenantDecorator.applyTenantToQueryOptions(userContext, queryOptions, this.pluralResourceName);
|
|
35
30
|
}
|
|
36
31
|
async prepareEntity(userContext, entity, isCreate, allowId = false) {
|
|
37
32
|
if (!config?.app?.isMultiTenant) {
|
package/dist/utils/db.utils.js
CHANGED
|
@@ -168,9 +168,6 @@ function buildMongoMatchFromQueryOptions(queryOptions, modelSpec) {
|
|
|
168
168
|
const filters = queryOptions.filters || {};
|
|
169
169
|
const schema = modelSpec?.fullSchema;
|
|
170
170
|
let match = {};
|
|
171
|
-
console.log('--- Building Mongo Match ---');
|
|
172
|
-
console.log('Received queryOptions.filters:', JSON.stringify(filters, null, 2));
|
|
173
|
-
console.log('Received modelSpec:', !!modelSpec);
|
|
174
171
|
for (const [key, value] of Object.entries(filters)) {
|
|
175
172
|
if (value) {
|
|
176
173
|
const propSchema = schema ? getPropertySchema(key, schema) : undefined;
|
|
@@ -220,8 +217,6 @@ function buildMongoMatchFromQueryOptions(queryOptions, modelSpec) {
|
|
|
220
217
|
}
|
|
221
218
|
}
|
|
222
219
|
}
|
|
223
|
-
console.log('Constructed $match object:', JSON.stringify(match, null, 2));
|
|
224
|
-
console.log('--------------------------');
|
|
225
220
|
return { $match: match };
|
|
226
221
|
}
|
|
227
222
|
function buildSQLWhereClauseFromQueryOptions(queryOptions, columnAliasMap) {
|