pg-mvc-service 1.0.5 → 1.0.6

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.
@@ -425,6 +425,8 @@ class TableModel {
425
425
  let refIndex = 1;
426
426
  const sql = `SELECT COUNT(*) as count FROM ${ref.table} WHERE ${ref.columns.map(col => `${col.ref} = $${refIndex++}`).join(" AND ")}`;
427
427
  const datas = yield this.clientQuery(sql, refValues);
428
+ console.log(datas);
429
+ console.log(datas.rows[0].count == "0");
428
430
  if (datas.rows[0].count == "0") {
429
431
  const name = ref.columns.map(col => { var _a; return (_a = this.getColumn(col.target).alias) !== null && _a !== void 0 ? _a : this.getColumn(col.target).columnName; }).join(',');
430
432
  this.throwValidationError("004", this.errorMessages.fk.replace('{name}', name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-mvc-service",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/n-daira/npm-pack_mvc-service#readme",
6
6
  "bugs": {
@@ -489,6 +489,8 @@ export class TableModel {
489
489
  let refIndex = 1;
490
490
  const sql = `SELECT COUNT(*) as count FROM ${ref.table} WHERE ${ref.columns.map(col => `${col.ref} = $${refIndex++}`).join(" AND ")}`;
491
491
  const datas = await this.clientQuery(sql, refValues);
492
+ console.log(datas);
493
+ console.log(datas.rows[0].count == "0");
492
494
  if (datas.rows[0].count == "0") {
493
495
  const name = ref.columns.map(col => this.getColumn(col.target).alias ?? this.getColumn(col.target).columnName).join(',');
494
496
  this.throwValidationError("004", this.errorMessages.fk.replace('{name}', name));