Browse Source

fix: add commit and rollback

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

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

@ -1945,10 +1945,13 @@ class BaseModelSqlv2 {
.del()
.where(await this._wherePk(id));
if (!_trx) await trx.commit();
await this.afterDelete(data, trx, cookie);
return response;
} catch (e) {
console.log(e);
if (!_trx) await trx.rollback();
await this.errorDelete(e, id, trx, cookie);
throw e;
}

Loading…
Cancel
Save