Browse Source

fix: transaction related correction in delete handler

Signed-off-by: Pranav C <pranavxc@gmail.com>
test/reset-fail
Pranav C 1 year ago
parent
commit
4f13be4429
  1. 6
      packages/nocodb/src/db/BaseModelSqlv2.ts

6
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -1943,16 +1943,14 @@ class BaseModelSqlv2 {
break;
}
}
const where = await this._wherePk(id);
if (!trx) {
trx = await this.dbDriver.transaction();
}
await Promise.all(execQueries.map((q) => q(trx)));
const response = await trx(this.tnPath)
.del()
.where(await this._wherePk(id));
const response = await trx(this.tnPath).del().where(where);
if (!_trx) await trx.commit();

Loading…
Cancel
Save