Browse Source

fix: use getMeta method to get table meta if not loaded already

pull/6786/head
Pranav C 11 months ago
parent
commit
01ae396557
  1. 5
      packages/nc-gui/components/erd/View.vue

5
packages/nc-gui/components/erd/View.vue

@ -59,11 +59,14 @@ const loadMetaOfTablesNotInMetas = async (localTables: TableType[]) => {
const populateTables = async () => { const populateTables = async () => {
let localTables: TableType[] = [] let localTables: TableType[] = []
if (props.table) { if (props.table) {
// use getMeta method to load meta since it will get meta if not loaded already
const tableMeta = await getMeta(props.table!.id!)
// if table is provided only get the table and its related tables // if table is provided only get the table and its related tables
localTables = baseTables.value.filter( localTables = baseTables.value.filter(
(t) => (t) =>
t.id === props.table?.id || t.id === props.table?.id ||
metas.value[props.table!.id!].columns?.find((column) => { tableMeta.columns?.find((column) => {
return isLinksOrLTAR(column.uidt) && (column.colOptions as LinkToAnotherRecordType)?.fk_related_model_id === t.id return isLinksOrLTAR(column.uidt) && (column.colOptions as LinkToAnotherRecordType)?.fk_related_model_id === t.id
}), }),
) )

Loading…
Cancel
Save