Browse Source

fix : bulk delete issue 509

Signed-off-by: Naveen MR <oof1lab@gmail.com>
pull/559/head
Naveen MR 3 years ago
parent
commit
43b0f81ecf
  1. 6
      packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts

6
packages/nocodb/src/lib/dataMapper/lib/sql/BaseModelSql.ts

@ -638,8 +638,10 @@ class BaseModelSql extends BaseModel {
const res = [];
for (const d of ids) {
const response = await this._run(transaction(this.tn).del().where(this._extractPks(d)));
res.push(response);
if(Object.keys(d).length) {
const response = await this._run(transaction(this.tn).del().where(d));
res.push(response);
}
}
await this.afterDeleteb(res, transaction);

Loading…
Cancel
Save