ismx-nexo-node-app 0.4.68 → 0.4.70

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.
@@ -86,8 +86,7 @@ class ServiceRestFormalTemplate {
86
86
  return __awaiter(this, void 0, void 0, function* () {
87
87
  let id = this.getFormalId(request);
88
88
  let entity = yield this.database.one(this.tableName, id);
89
- let result = yield this.extendEntity(entity);
90
- return Service_1.HttpResponse.ok(result);
89
+ return Service_1.HttpResponse.ok(entity ? yield this.extendEntity(entity) : entity);
91
90
  });
92
91
  }
93
92
  /**
@@ -12,7 +12,7 @@ class PostgresUtils {
12
12
  if (typeof obj === 'function' || obj !== Object(obj) || obj instanceof Date)
13
13
  return obj;
14
14
  return PostgresUtils.fromEntries(Object.entries(obj).map(([key, value]) => [
15
- PostgresUtils.snakeToCamel(key), PostgresUtils.snakeToCamel(value),
15
+ PostgresUtils.snakeToCamel(key), value,
16
16
  ]));
17
17
  }
18
18
  static columns(table) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.68",
3
+ "version": "0.4.70",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -97,8 +97,7 @@ export default class ServiceRestFormalTemplate<Model=any>
97
97
  protected async serveGet(request: HttpRequest): Promise<HttpResponse<Model>> {
98
98
  let id = this.getFormalId(request);
99
99
  let entity = await this.database.one<Model>(this.tableName, id);
100
- let result = await this.extendEntity(entity);
101
- return HttpResponse.ok(result);
100
+ return HttpResponse.ok(entity ? await this.extendEntity(entity) : entity);
102
101
  }
103
102
 
104
103
  /**
@@ -23,7 +23,7 @@ export default abstract class PostgresUtils
23
23
 
24
24
  return PostgresUtils.fromEntries(
25
25
  Object.entries(obj).map(([key, value]) => [
26
- PostgresUtils.snakeToCamel(key), PostgresUtils.snakeToCamel(value),
26
+ PostgresUtils.snakeToCamel(key), value,
27
27
  ]),
28
28
  );
29
29
  }