Browse Source

fix(nocodb): typo and data position in delByPk

pull/5349/head
Wing-Kam Wong 2 years ago
parent
commit
766189302b
  1. 4
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

4
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -1631,7 +1631,7 @@ class BaseModelSqlv2 {
async delByPk(id, trx?, cookie?) { async delByPk(id, trx?, cookie?) {
try { try {
// retrieve data for handling paramas in hook // retrieve data for handling params in hook
const data = await this.readByPk(id); const data = await this.readByPk(id);
await this.beforeDelete(id, trx, cookie); await this.beforeDelete(id, trx, cookie);
const response = await this.dbDriver(this.tnPath) const response = await this.dbDriver(this.tnPath)
@ -2248,7 +2248,7 @@ class BaseModelSqlv2 {
user: req?.user?.email, user: req?.user?.email,
}); });
// } // }
await this.handleHooks('After.delete', null, data, req); await this.handleHooks('After.delete', data, null, req);
} }
private async handleHooks(hookName, prevData, newData, req): Promise<void> { private async handleHooks(hookName, prevData, newData, req): Promise<void> {

Loading…
Cancel
Save