Browse Source

fix: remove promise.all

pull/9913/head
DarkPhoenix2704 3 days ago
parent
commit
5f7f1121a2
  1. 6
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -5336,6 +5336,7 @@ class BaseModelSqlv2 {
if (pkValues !== 'N/A' && pkValues !== undefined) {
dataWithPks.push({ pk: pkValues, data });
} else {
await this.prepareNocoData(data, true, cookie)
// const insertObj = this.handleValidateBulkInsert(data, columns);
dataWithoutPks.push(data);
}
@ -5355,16 +5356,15 @@ class BaseModelSqlv2 {
for (const { pk, data } of dataWithPks) {
if (existingPkSet.has(pk)) {
await this.prepareNocoData(data, false, cookie)
toUpdate.push(data);
} else {
await this.prepareNocoData(data, true, cookie)
// const insertObj = this.handleValidateBulkInsert(data, columns);
toInsert.push(data);
}
}
await Promise.all(toInsert.map((d) => this.prepareNocoData(d, true, cookie)))
await Promise.all(toUpdate.map((d) => this.prepareNocoData(d, false, cookie)))
trx = await this.dbDriver.transaction();
const updatedPks = [];

Loading…
Cancel
Save