1
0
Fork 0
mirror of synced 2024-07-13 18:26:06 +12:00

More types

This commit is contained in:
Adria Navarro 2023-10-11 13:37:50 +02:00
parent 1e8aa9eb60
commit a3b3c176d3

View file

@ -109,8 +109,8 @@ export async function getLinkedTable(id: string, tables: Table[]) {
export function getRelatedTableForField(table: Table, fieldName: string) {
// look to see if its on the table, straight in the schema
const field = table.schema[fieldName]
if (field != null) {
return (field as any).tableId
if (field?.type === FieldTypes.LINK) {
return field.tableId
}
for (let column of Object.values(table.schema)) {
if (column.type === FieldTypes.LINK && column.fieldName === fieldName) {