From fb053489fdf9bc0dfd64fb2c5f42df4e0b9d63a4 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 24 Oct 2022 12:43:07 +0800 Subject: [PATCH] fix(nc-gui): populate unique table name in non importDataOnly case only --- packages/nc-gui/components/dlg/QuickImport.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/dlg/QuickImport.vue b/packages/nc-gui/components/dlg/QuickImport.vue index 1dd6f98137..ce56cd3006 100644 --- a/packages/nc-gui/components/dlg/QuickImport.vue +++ b/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() - templateData.value.tables = templateData.value.tables.map((table: Record) => ({ - ...table, - table_name: populateUniqueTableName(table.table_name), - })) 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) => ({ + ...table, + table_name: populateUniqueTableName(table.table_name), + })) + } importData.value = templateGenerator!.getData() templateEditorModal.value = true isParsingData.value = false