Making sure relationships are valid before displaying them.

This commit is contained in:
mike12345567 2023-12-12 15:11:04 +00:00
parent 1b4cb0e2eb
commit f6acfc2795
1 changed files with 10 additions and 8 deletions

View File

@ -44,14 +44,16 @@
})
})
return Object.values(relatedColumns).map(({ from, to, through }) => {
return {
tables: `${from.tableName} ${through ? "↔" : "→"} ${to.tableName}`,
columns: `${from.name} to ${to.name}`,
from,
to,
}
})
return Object.values(relatedColumns)
.filter(({ from, to }) => from && to)
.map(({ from, to, through }) => {
return {
tables: `${from.tableName} ${through ? "↔" : "→"} ${to.tableName}`,
columns: `${from.name} to ${to.name}`,
from,
to,
}
})
}
const handleRowClick = ({ detail }) => {