ismx-nexo-node-app 0.4.123 → 0.4.124

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.
@@ -128,6 +128,8 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
129
  if (!this.tables[tableName])
130
130
  throw new Error(`table ${tableName} does not exist`);
131
+ if (objects.length === 0)
132
+ return [];
131
133
  let table = this.tables[tableName];
132
134
  let schema = table[0].schema;
133
135
  let columns = PostgresUtils_1.default.columns(table);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.123",
3
+ "version": "0.4.124",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -102,6 +102,8 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
102
102
  async addAll<T>(tableName: string, objects: ({[key:string]:Valuable }|any)[]): Promise<T[]>
103
103
  {
104
104
  if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
105
+ if (objects.length === 0) return [];
106
+
105
107
  let table = this.tables[tableName];
106
108
  let schema = table[0].schema;
107
109
  let columns = PostgresUtils.columns(table);