Fix relatedcolumns return type
This commit is contained in:
parent
81ed65b099
commit
1714a3cc1d
|
@ -26,12 +26,14 @@
|
||||||
const getSchema = (asset, datasource) => {
|
const getSchema = (asset, datasource) => {
|
||||||
const schema = getSchemaForDatasource(asset, datasource).schema
|
const schema = getSchemaForDatasource(asset, datasource).schema
|
||||||
|
|
||||||
// Don't show ID and rev in tables
|
if (!schema) {
|
||||||
if (schema) {
|
return
|
||||||
delete schema._id
|
|
||||||
delete schema._rev
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't show ID and rev in tables
|
||||||
|
delete schema._id
|
||||||
|
delete schema._rev
|
||||||
|
|
||||||
const result = enrichSchemaWithRelColumns(schema)
|
const result = enrichSchemaWithRelColumns(schema)
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,10 +46,7 @@ const columnTypeManyParser = {
|
||||||
|
|
||||||
export function enrichSchemaWithRelColumns(
|
export function enrichSchemaWithRelColumns(
|
||||||
schema: Record<string, UIFieldSchema>
|
schema: Record<string, UIFieldSchema>
|
||||||
): Record<string, UIFieldSchema> | undefined {
|
): Record<string, UIFieldSchema> {
|
||||||
if (!schema) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const result = Object.keys(schema).reduce<Record<string, UIFieldSchema>>(
|
const result = Object.keys(schema).reduce<Record<string, UIFieldSchema>>(
|
||||||
(result, fieldName) => {
|
(result, fieldName) => {
|
||||||
const field = schema[fieldName]
|
const field = schema[fieldName]
|
||||||
|
|
Loading…
Reference in New Issue