From 58d7293798f65c563938108cbd89042619b8c434 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 22 Jun 2023 13:25:37 +0100 Subject: [PATCH] PR suggestion. --- packages/server/src/api/controllers/row/utils.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/server/src/api/controllers/row/utils.ts b/packages/server/src/api/controllers/row/utils.ts index 7309f0b7a5..a213f14a08 100644 --- a/packages/server/src/api/controllers/row/utils.ts +++ b/packages/server/src/api/controllers/row/utils.ts @@ -24,12 +24,7 @@ function isForeignKey(key: string, table: Table) { const relationships = Object.values(table.schema).filter( column => column.type === FieldType.LINK ) - for (let relationship of relationships) { - if (relationship.foreignKey === key) { - return true - } - } - return false + return relationships.some(relationship => relationship.foreignKey === key) } export async function getDatasourceAndQuery(json: any) {