PR suggestion.

This commit is contained in:
mike12345567 2023-06-22 13:25:37 +01:00
parent 5373b867e1
commit 58d7293798
1 changed files with 1 additions and 6 deletions

View File

@ -24,12 +24,7 @@ function isForeignKey(key: string, table: Table) {
const relationships = Object.values(table.schema).filter( const relationships = Object.values(table.schema).filter(
column => column.type === FieldType.LINK column => column.type === FieldType.LINK
) )
for (let relationship of relationships) { return relationships.some(relationship => relationship.foreignKey === key)
if (relationship.foreignKey === key) {
return true
}
}
return false
} }
export async function getDatasourceAndQuery(json: any) { export async function getDatasourceAndQuery(json: any) {