ismx-nexo-node-app 0.4.75 → 0.4.76
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,8 +156,6 @@ 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
|
-
throw new Error(`No valid columns provided to update for table ${tableName}`);
|
|
161
159
|
const params = columns.map((_, index) => `\$${index + 2}`).join(",");
|
|
162
160
|
const values = [id, ...columns.map((column) => object[PostgresUtils_1.default.snakeToCamel(column)])];
|
|
163
161
|
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
|
package/package.json
CHANGED
|
@@ -131,8 +131,6 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
131
131
|
return Object.prototype.hasOwnProperty.call(object, camelKey);
|
|
132
132
|
});
|
|
133
133
|
|
|
134
|
-
if (columns.length === 0) throw new Error(`No valid columns provided to update for table ${tableName}`);
|
|
135
|
-
|
|
136
134
|
const params = columns.map((_, index) => `\$${index + 2}`).join(",");
|
|
137
135
|
const values = [ id, ...columns.map((column) => object[PostgresUtils.snakeToCamel(column) as keyof T]) ];
|
|
138
136
|
const query = `UPDATE ${schema}.${tableName} SET (${columns.join(",")}) = ROW(${params}) WHERE id = $1 RETURNING *`;
|