From bd5bac4ef2e963b8e29a7c0b47e1775766f54d55 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 25 Feb 2021 11:06:46 +0000 Subject: [PATCH] Add support for new relationship objects in client app bindings --- packages/client/src/api/rows.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/client/src/api/rows.js b/packages/client/src/api/rows.js index 54c0179cc8..639516f0f6 100644 --- a/packages/client/src/api/rows.js +++ b/packages/client/src/api/rows.js @@ -120,7 +120,11 @@ export const enrichRows = async (rows, tableId) => { const type = schema[key].type if (type === "link") { // Enrich row a string join of relationship fields - row[`${key}_text`] = row[key]?.join(", ") || "" + row[`${key}_text`] = + row[key] + ?.map(option => option?.primaryDisplay) + .filter(option => !!option) + .join(", ") || "" } else if (type === "attachment") { // Enrich row with the first image URL for any attachment fields let url = null