From ff855a677a98aeabd5df955eb156e9fd12836358 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Tue, 20 Aug 2024 13:27:20 +0100 Subject: [PATCH] PR comments. --- packages/server/src/db/linkedRows/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/server/src/db/linkedRows/index.ts b/packages/server/src/db/linkedRows/index.ts index 037e53d02f..2da7e212b9 100644 --- a/packages/server/src/db/linkedRows/index.ts +++ b/packages/server/src/db/linkedRows/index.ts @@ -229,12 +229,12 @@ function getPrimaryDisplayValue(row: Row, table?: Table) { invalid = INVALID_DISPLAY_COLUMN_TYPE.includes(primaryDisplaySchema.type) } if (invalid || !primaryDisplay) { - const validKey = Object.keys(table?.schema || {}).filter( + const validKey = Object.keys(table?.schema || {}).find( key => table?.schema[key].type && !INVALID_DISPLAY_COLUMN_TYPE.includes(table?.schema[key].type) ) - return validKey[0] ? row[validKey[0]] : undefined + return validKey ? row[validKey] : undefined } else { return row[primaryDisplay] }