Fix relatedcolumns return type
This commit is contained in:
parent
81ed65b099
commit
1714a3cc1d
|
@ -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
|
||||
}
|
||||
|
|
|
@ -46,10 +46,7 @@ const columnTypeManyParser = {
|
|||
|
||||
export function enrichSchemaWithRelColumns(
|
||||
schema: Record<string, UIFieldSchema>
|
||||
): Record<string, UIFieldSchema> | undefined {
|
||||
if (!schema) {
|
||||
return
|
||||
}
|
||||
): Record<string, UIFieldSchema> {
|
||||
const result = Object.keys(schema).reduce<Record<string, UIFieldSchema>>(
|
||||
(result, fieldName) => {
|
||||
const field = schema[fieldName]
|
||||
|
|
Loading…
Reference in New Issue