ismx-nexo-node-app 0.4.76 → 0.4.77

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.
@@ -156,6 +156,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
156
156
  const camelKey = PostgresUtils_1.default.snakeToCamel(column);
157
157
  return Object.prototype.hasOwnProperty.call(object, camelKey);
158
158
  });
159
+ if (columns.length === 0)
160
+ return this.one(tableName, id);
159
161
  const params = columns.map((_, index) => `\$${index + 2}`).join(",");
160
162
  const values = [id, ...columns.map((column) => object[PostgresUtils_1.default.snakeToCamel(column)])];
161
163
  const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.76",
3
+ "version": "0.4.77",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -131,6 +131,8 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
131
131
  return Object.prototype.hasOwnProperty.call(object, camelKey);
132
132
  });
133
133
 
134
+ if (columns.length === 0) return this.one(tableName, id);
135
+
134
136
  const params = columns.map((_, index) => `\$${index + 2}`).join(",");
135
137
  const values = [ id, ...columns.map((column) => object[PostgresUtils.snakeToCamel(column) as keyof T]) ];
136
138
  const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;