Browse Source

fix: pass original data instead of delete response

pull/2025/head
Wing-Kam Wong 3 years ago
parent
commit
8a3fe24168
  1. 5
      packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts

5
packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts

@ -1260,12 +1260,13 @@ class BaseModelSqlv2 {
async delByPk(id, trx?, cookie?) {
try {
// retrieve data for handling paramas in hook
const data = await this.readByPk(id);
await this.beforeDelete(id, trx, cookie);
const response = await this.dbDriver(this.tnPath)
.del()
.where(await this._wherePk(id));
await this.afterDelete(response, trx, cookie);
await this.afterDelete(data, trx, cookie);
return response;
} catch (e) {
console.log(e);

Loading…
Cancel
Save