ismx-nexo-node-app 0.4.20 → 0.4.21

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.
@@ -160,7 +160,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
160
160
  throw new Error(`No valid columns provided to update for table ${tableName}`);
161
161
  const params = columns.map((_, index) => `\$${index + 2}`).join(",");
162
162
  const values = [id, ...columns.map((column) => object[PostgresUtils_1.default.stringToCamel(column)])];
163
- const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = (${params}) WHERE id = $1 RETURNING *`;
163
+ const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
164
164
  return this.query(query, values).then((result) => result[0]);
165
165
  });
166
166
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -135,7 +135,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
135
135
 
136
136
  const params = columns.map((_, index) => `\$${index + 2}`).join(",");
137
137
  const values = [ id, ...columns.map((column) => object[PostgresUtils.stringToCamel(column) as keyof T]) ];
138
- const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = (${params}) WHERE id = $1 RETURNING *`;
138
+ const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
139
139
 
140
140
  return this.query<T>(query, values).then((result) => result[0]);
141
141
  }