@loomcore/api 0.0.51 → 0.0.52
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.
|
@@ -52,8 +52,10 @@ export class ApiController {
|
|
|
52
52
|
apiUtils.apiResponse(res, 200, { data: pagedResult }, this.modelSpec, this.publicSchema);
|
|
53
53
|
}
|
|
54
54
|
async getById(req, res, next) {
|
|
55
|
+
console.log('Starting getById, id:', req.params?.id);
|
|
55
56
|
let id = req.params?.id;
|
|
56
57
|
res.set('Content-Type', 'application/json');
|
|
58
|
+
console.log('Calling this.service.getById()');
|
|
57
59
|
const entity = await this.service.getById(req.userContext, id);
|
|
58
60
|
apiUtils.apiResponse(res, 200, { data: entity }, this.modelSpec, this.publicSchema);
|
|
59
61
|
}
|
|
@@ -73,6 +73,7 @@ export class GenericApiService {
|
|
|
73
73
|
return pipeline;
|
|
74
74
|
}
|
|
75
75
|
async getAll(userContext) {
|
|
76
|
+
console.log('In GenericApiService.getAll');
|
|
76
77
|
const query = this.prepareQuery(userContext, {});
|
|
77
78
|
let entities = [];
|
|
78
79
|
if (this.getAdditionalPipelineStages().length > 0) {
|
|
@@ -86,6 +87,7 @@ export class GenericApiService {
|
|
|
86
87
|
return this.transformList(entities);
|
|
87
88
|
}
|
|
88
89
|
async get(userContext, queryOptions = { ...DefaultQueryOptions }) {
|
|
90
|
+
console.log('In GenericApiService.get');
|
|
89
91
|
const preparedOptions = this.prepareQueryOptions(userContext, queryOptions);
|
|
90
92
|
const match = dbUtils.buildMongoMatchFromQueryOptions(preparedOptions);
|
|
91
93
|
const additionalStages = this.getAdditionalPipelineStages();
|