Fix fetching BB_reference arrays

This commit is contained in:
Adria Navarro 2024-05-03 16:10:36 +02:00
parent b3ff417844
commit ab647d1f0f
1 changed files with 4 additions and 1 deletions

View File

@ -104,7 +104,10 @@ export function basicProcessing({
export function fixArrayTypes(row: Row, table: Table) { export function fixArrayTypes(row: Row, table: Table) {
for (let [fieldName, schema] of Object.entries(table.schema)) { 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 { try {
row[fieldName] = JSON.parse(row[fieldName]) row[fieldName] = JSON.parse(row[fieldName])
} catch (err) { } catch (err) {