diff --git a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/GridColumnConfiguration.svelte b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/GridColumnConfiguration.svelte index 5b3d1ec5a2..46aea2a6c4 100644 --- a/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/GridColumnConfiguration.svelte +++ b/packages/builder/src/components/design/settings/controls/GridColumnConfiguration/GridColumnConfiguration.svelte @@ -26,12 +26,14 @@ const getSchema = (asset, datasource) => { const schema = getSchemaForDatasource(asset, datasource).schema - // Don't show ID and rev in tables - if (schema) { - delete schema._id - delete schema._rev + if (!schema) { + return } + // Don't show ID and rev in tables + delete schema._id + delete schema._rev + const result = enrichSchemaWithRelColumns(schema) return result } diff --git a/packages/frontend-core/src/utils/relatedColumns.ts b/packages/frontend-core/src/utils/relatedColumns.ts index e7bd3662d3..7bec526605 100644 --- a/packages/frontend-core/src/utils/relatedColumns.ts +++ b/packages/frontend-core/src/utils/relatedColumns.ts @@ -46,10 +46,7 @@ const columnTypeManyParser = { export function enrichSchemaWithRelColumns( schema: Record -): Record | undefined { - if (!schema) { - return - } +): Record { const result = Object.keys(schema).reduce>( (result, fieldName) => { const field = schema[fieldName]