mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 08:28:35 +00:00
Do not auto generate columns for nested data (#4627)
This commit is contained in:
parent
1a3f0521b6
commit
4a2e7d3bdf
1 changed files with 5 additions and 1 deletions
|
|
@ -4,7 +4,11 @@ import { v4 as uuidv4 } from 'uuid';
|
|||
export default function autogenerateColumns(tableData, existingColumns, columnDeletionHistory, setProperty) {
|
||||
const firstRow = tableData?.[0] ?? {};
|
||||
|
||||
const keysOfTableData = Object.keys(firstRow);
|
||||
const firstRowWithoutNestedElements = Object.fromEntries(
|
||||
Object.entries(firstRow).filter(([_key, value]) => typeof value != 'object')
|
||||
);
|
||||
|
||||
const keysOfTableData = Object.keys(firstRowWithoutNestedElements);
|
||||
|
||||
const keysOfExistingColumns = existingColumns.map((column) => column.key || column.name);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue