Browse Source

refactor: use `tables` reactive var and if not found then look in metas

pull/8367/head
Pranav C 5 months ago
parent
commit
9d93060b6f
  1. 4
      packages/nc-gui/components/smartsheet/column/LookupOptions.vue

4
packages/nc-gui/components/smartsheet/column/LookupOptions.vue

@ -42,7 +42,9 @@ const refTables = computed(() => {
.map((column) => ({
col: column.colOptions,
column,
...(metas.value[(column.colOptions as LinkToAnotherRecordType).fk_related_model_id] || {}),
...(tables.value.find((table) => table.id === (column.colOptions as LinkToAnotherRecordType).fk_related_model_id) ||
metas.value[(column.colOptions as LinkToAnotherRecordType).fk_related_model_id!] ||
{}),
}))
.filter((table) => (table.col as LinkToAnotherRecordType)?.fk_related_model_id === table.id && !table.mm)
return _refTables as Required<TableType & { column: ColumnType; col: Required<LinkToAnotherRecordType> }>[]

Loading…
Cancel
Save