diff --git a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts b/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts index 49b14d966a..f9e67c6222 100644 --- a/packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSqlv2.ts +++ b/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);