Browse Source

fix(nc-gui): populate unique table name in non importDataOnly case only

pull/4135/head
Wing-Kam Wong 2 years ago
parent
commit
fb053489fd
  1. 5
      packages/nc-gui/components/dlg/QuickImport.vue

5
packages/nc-gui/components/dlg/QuickImport.vue

@ -200,11 +200,14 @@ async function parseAndExtractData(val: UploadFile[] | ArrayBuffer | string) {
await templateGenerator.parse()
templateData.value = templateGenerator!.getTemplate()
if (importDataOnly) importColumns.value = templateGenerator!.getColumns()
else {
// ensure the target table name not exist in current table list
templateData.value.tables = templateData.value.tables.map((table: Record<string, any>) => ({
...table,
table_name: populateUniqueTableName(table.table_name),
}))
if (importDataOnly) importColumns.value = templateGenerator!.getColumns()
}
importData.value = templateGenerator!.getData()
templateEditorModal.value = true
isParsingData.value = false

Loading…
Cancel
Save