1
0
Fork 0
mirror of synced 2024-08-09 07:08:01 +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) { export function getRelatedTableForField(table: Table, fieldName: string) {
// look to see if its on the table, straight in the schema // look to see if its on the table, straight in the schema
const field = table.schema[fieldName] const field = table.schema[fieldName]
if (field != null) { if (field?.type === FieldTypes.LINK) {
return (field as any).tableId return field.tableId
} }
for (let column of Object.values(table.schema)) { for (let column of Object.values(table.schema)) {
if (column.type === FieldTypes.LINK && column.fieldName === fieldName) { if (column.type === FieldTypes.LINK && column.fieldName === fieldName) {