Browse Source

fix: bulkupsert endpoint

pull/9913/head
DarkPhoenix2704 6 days ago
parent
commit
c04acbfe76
  1. 7
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -5332,10 +5332,6 @@ class BaseModelSqlv2 {
const dataWithoutPks = []; const dataWithoutPks = [];
for (const data of preparedDatas) { for (const data of preparedDatas) {
if (!raw) {
await this.prepareNocoData(data, true, cookie);
}
const pkValues = this.extractPksValues(data); const pkValues = this.extractPksValues(data);
if (pkValues !== 'N/A' && pkValues !== undefined) { if (pkValues !== 'N/A' && pkValues !== undefined) {
dataWithPks.push({ pk: pkValues, data }); dataWithPks.push({ pk: pkValues, data });
@ -5366,6 +5362,9 @@ class BaseModelSqlv2 {
} }
} }
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(); trx = await this.dbDriver.transaction();
const updatedPks = []; const updatedPks = [];

Loading…
Cancel
Save