From 84bab434bf86155ab2e8bf34031b0abc6d5ddcee Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 22 Aug 2024 16:59:47 +0200 Subject: [PATCH] Don't include primary display columns by default --- packages/server/src/sdk/app/tables/getters.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/server/src/sdk/app/tables/getters.ts b/packages/server/src/sdk/app/tables/getters.ts index a6bdf62d58..f3e2e97795 100644 --- a/packages/server/src/sdk/app/tables/getters.ts +++ b/packages/server/src/sdk/app/tables/getters.ts @@ -157,6 +157,8 @@ export async function enrichRelationshipSchema( } const relTable = tableCache[field.tableId] + const fieldSchema = field.schema || {} + const resultSchema: Record = {} for (const relTableFieldName of Object.keys(relTable.schema)) { @@ -169,10 +171,7 @@ export async function enrichRelationshipSchema( continue } - const isPrimaryDisplay = relTableFieldName === relTable.primaryDisplay - const isReadonly = - isPrimaryDisplay || - !!(field.schema && field.schema[relTableFieldName]?.readonly) + const isReadonly = !!fieldSchema[relTableFieldName]?.readonly resultSchema[relTableFieldName] = { visible: isReadonly, readonly: isReadonly,