Browse Source

Merge pull request #9913 from nocodb/nc-fix-bulkupser

fix: bulkupsert endpoint
pull/7885/merge
Pranav C 3 days ago committed by GitHub
parent
commit
fab6f1a8cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      packages/nocodb/src/db/BaseModelSqlv2.ts

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

@ -5332,14 +5332,11 @@ class BaseModelSqlv2 {
const dataWithoutPks = [];
for (const data of preparedDatas) {
if (!raw) {
await this.prepareNocoData(data, true, cookie);
}
const pkValues = this.extractPksValues(data);
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);
}
@ -5359,8 +5356,10 @@ 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);
}

Loading…
Cancel
Save