1
0
Fork 0
mirror of synced 2024-09-12 23:43:09 +12:00

Fix fetching BB_reference arrays

This commit is contained in:
Adria Navarro 2024-05-03 16:10:36 +02:00
parent b3ff417844
commit ab647d1f0f

View file

@ -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) {