ismx-nexo-node-app 0.3.32 → 0.3.33
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.
|
@@ -158,7 +158,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
|
|
|
158
158
|
if (!this.tables[tableName])
|
|
159
159
|
throw new Error(`table ${tableName} does not exist`);
|
|
160
160
|
let { where, values } = this.toQuery(tableName, filters);
|
|
161
|
-
let query = `SELECT json_agg(
|
|
161
|
+
let query = `SELECT json_agg(u.${select}) as list FROM ${this.schema}.${tableName} u WHERE ${where}`;
|
|
162
162
|
return this.query(query, values).then((result) => result[0].list);
|
|
163
163
|
});
|
|
164
164
|
}
|
package/package.json
CHANGED
|
@@ -158,7 +158,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
|
|
|
158
158
|
{
|
|
159
159
|
if (!this.tables[tableName]) throw new Error(`table ${tableName} does not exist`);
|
|
160
160
|
let { where, values } = this.toQuery(tableName, filters);
|
|
161
|
-
let query = `SELECT json_agg(
|
|
161
|
+
let query = `SELECT json_agg(u.${select}) as list FROM ${this.schema}.${tableName} u WHERE ${where}`
|
|
162
162
|
return this.query<{list:string[]}>(query, values).then((result) => result[0].list);
|
|
163
163
|
}
|
|
164
164
|
|