Browse Source

fix: data inserted into default column after using the delete data block

Ahmad Kholid 3 years ago
parent
commit
eca041cc7b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/background/workflowEngine/blocksHandler/handlerDeleteData.js

+ 4 - 3
src/background/workflowEngine/blocksHandler/handlerDeleteData.js

@@ -6,9 +6,10 @@ function deleteData({ data, outputs }) {
       if (item.type === 'table') {
         if (item.columnId === '[all]') {
           this.engine.referenceData.table = [];
-          this.engine.columns = {
-            column: { index: 0, name: 'column', type: 'any' },
-          };
+
+          Object.keys(this.engine.columns).forEach((key) => {
+            this.engine.columns[key].index = 0;
+          });
         } else {
           const columnName = this.engine.columns[item.columnId].name;