|
|
@ -5293,9 +5293,7 @@ class BaseModelSqlv2 { |
|
|
|
await this.model.getColumns(this.context); |
|
|
|
await this.model.getColumns(this.context); |
|
|
|
|
|
|
|
|
|
|
|
await Promise.all( |
|
|
|
await Promise.all( |
|
|
|
insertDatas.map( |
|
|
|
insertDatas.map((d) => this.prepareNocoData(d, true, cookie)), |
|
|
|
async (d) => await this.prepareNocoData(d, true, cookie), |
|
|
|
|
|
|
|
), |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -6006,12 +6004,23 @@ class BaseModelSqlv2 { |
|
|
|
for (const c of attachmentColumns) { |
|
|
|
for (const c of attachmentColumns) { |
|
|
|
if (row[c.column_name]) { |
|
|
|
if (row[c.column_name]) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const attachments = JSON.parse(row[c.column_name]); |
|
|
|
let attachments; |
|
|
|
|
|
|
|
if (typeof row[c.column_name] === 'string') { |
|
|
|
|
|
|
|
attachments = JSON.parse(row[c.column_name]); |
|
|
|
for (const attachment of attachments) { |
|
|
|
for (const attachment of attachments) { |
|
|
|
if (attachment.id) { |
|
|
|
if (attachment.id) { |
|
|
|
fileReferenceIds.push(attachment.id); |
|
|
|
fileReferenceIds.push(attachment.id); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(attachments)) { |
|
|
|
|
|
|
|
for (const attachment of attachments) { |
|
|
|
|
|
|
|
if (attachment.id) { |
|
|
|
|
|
|
|
fileReferenceIds.push(attachment.id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|