From ab647d1f0f982d97ba6699b5a51753ee151d3976 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Fri, 3 May 2024 16:10:36 +0200 Subject: [PATCH] Fix fetching BB_reference arrays --- packages/server/src/api/controllers/row/utils/basic.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/utils/basic.ts b/packages/server/src/api/controllers/row/utils/basic.ts index 6255e13c1c..02f92e15e9 100644 --- a/packages/server/src/api/controllers/row/utils/basic.ts +++ b/packages/server/src/api/controllers/row/utils/basic.ts @@ -104,7 +104,10 @@ export function basicProcessing({ export function fixArrayTypes(row: Row, table: Table) { for (let [fieldName, schema] of Object.entries(table.schema)) { - if (schema.type === FieldType.ARRAY && typeof row[fieldName] === "string") { + if ( + [FieldType.ARRAY, FieldType.BB_REFERENCE].includes(schema.type) && + typeof row[fieldName] === "string" + ) { try { row[fieldName] = JSON.parse(row[fieldName]) } catch (err) {