ismx-nexo-node-app 0.4.117 → 0.4.118

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.
@@ -237,7 +237,7 @@ class RepositoryDatabasePostgres extends RepositoryDatabase_1.default {
237
237
  return __awaiter(this, arguments, void 0, function* (name, params = [], filters = {}) {
238
238
  var _a;
239
239
  let { where, values } = this.anyWhere(filters);
240
- let placeholders = (_a = params === null || params === void 0 ? void 0 : params.map((_, index) => "$" + (index + 1 + where.length))) !== null && _a !== void 0 ? _a : [];
240
+ let placeholders = (_a = params === null || params === void 0 ? void 0 : params.map((_, index) => "$" + (index + 1 + values.length))) !== null && _a !== void 0 ? _a : [];
241
241
  let query = `SELECT ${name}(${placeholders.join(',')}) WHERE ${where}`;
242
242
  return this.query(query, [...values, ...params]);
243
243
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ismx-nexo-node-app",
3
- "version": "0.4.117",
3
+ "version": "0.4.118",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "build": "rm -rf ./dist && npx tsc",
@@ -207,7 +207,7 @@ export default class RepositoryDatabasePostgres extends RepositoryDatabase
207
207
  async run<T>(name: string, params: Valuable[] = [], filters: Partial<T> = {}): Promise<T[]>
208
208
  {
209
209
  let { where, values } = this.anyWhere(filters as any);
210
- let placeholders = params?.map((_, index) => "$"+(index+1+where.length)) ?? [];
210
+ let placeholders = params?.map((_, index) => "$"+(index+1+values.length)) ?? [];
211
211
  let query = `SELECT ${name}(${placeholders.join(',')}) WHERE ${where}`;
212
212
  return this.query<any>(query, [ ...values, ...params ])
213
213
  }