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; break;
} }
} }
const where = await this._wherePk(id);
if (!trx) { if (!trx) {
trx = await this.dbDriver.transaction(); trx = await this.dbDriver.transaction();
} }
await Promise.all(execQueries.map((q) => q(trx))); await Promise.all(execQueries.map((q) => q(trx)));
const response = await trx(this.tnPath) const response = await trx(this.tnPath).del().where(where);
.del()
.where(await this._wherePk(id));
if (!_trx) await trx.commit(); if (!_trx) await trx.commit();

Loading…
Cancel
Save