Browse Source

fix: pass original data instead of delete response

pull/2025/head
Wing-Kam Wong 2 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?) { async delByPk(id, trx?, cookie?) {
try { try {
// retrieve data for handling paramas in hook
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)
.del() .del()
.where(await this._wherePk(id)); .where(await this._wherePk(id));
await this.afterDelete(response, trx, cookie); await this.afterDelete(data, trx, cookie);
return response; return response;
} catch (e) { } catch (e) {
console.log(e); console.log(e);

Loading…
Cancel
Save