|
|
@ -1987,11 +1987,15 @@ class BaseModelSqlv2 { |
|
|
|
async bulkDelete(ids: any[], { cookie }: { cookie?: any } = {}) { |
|
|
|
async bulkDelete(ids: any[], { cookie }: { cookie?: any } = {}) { |
|
|
|
let transaction; |
|
|
|
let transaction; |
|
|
|
try { |
|
|
|
try { |
|
|
|
|
|
|
|
const deleteIds = await Promise.all( |
|
|
|
|
|
|
|
ids.map((d) => this.model.mapAliasToColumn(d)) |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
transaction = await this.dbDriver.transaction(); |
|
|
|
transaction = await this.dbDriver.transaction(); |
|
|
|
// await this.beforeDeleteb(ids, transaction);
|
|
|
|
// await this.beforeDeleteb(ids, transaction);
|
|
|
|
|
|
|
|
|
|
|
|
const res = []; |
|
|
|
const res = []; |
|
|
|
for (const d of ids) { |
|
|
|
for (const d of deleteIds) { |
|
|
|
if (Object.keys(d).length) { |
|
|
|
if (Object.keys(d).length) { |
|
|
|
const response = await transaction(this.model.table_name) |
|
|
|
const response = await transaction(this.model.table_name) |
|
|
|
.del() |
|
|
|
.del() |
|
|
|