More types
This commit is contained in:
parent
1e8aa9eb60
commit
a3b3c176d3
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue