Hide undefineds
This commit is contained in:
parent
d8744e1b72
commit
e9940ce43e
|
@ -223,11 +223,19 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
const displayRelationshipFields = relationship => {
|
const displayRelationshipFields = relationship => {
|
||||||
|
const fields = {}
|
||||||
for (const column of Object.entries(schema.columns)
|
for (const column of Object.entries(schema.columns)
|
||||||
.filter(([_, column]) => column.visible !== false)
|
.filter(
|
||||||
|
([key, column]) =>
|
||||||
|
column.visible !== false &&
|
||||||
|
relationship[key] !== null &&
|
||||||
|
relationship[key] !== undefined
|
||||||
|
)
|
||||||
.map(([key]) => key)) {
|
.map(([key]) => key)) {
|
||||||
relationshipFields ??= {}
|
fields[column] = relationship[column]
|
||||||
relationshipFields[column] = relationship[column]
|
}
|
||||||
|
if (Object.keys(fields).length) {
|
||||||
|
relationshipFields = fields
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue