Clean and populate url

This commit is contained in:
Adria Navarro 2024-04-03 16:43:12 +02:00
parent d8afb0f58c
commit a4c8fcb2ac
1 changed files with 15 additions and 0 deletions

View File

@ -155,6 +155,11 @@ export async function inputProcessing(
delete attachment.url delete attachment.url
}) })
} }
} else if (field.type === FieldType.ATTACHMENT_SINGLE) {
const attachment = clonedRow[key]
if (attachment?.url) {
delete clonedRow[key].url
}
} }
if (field.type === FieldType.BB_REFERENCE && value) { if (field.type === FieldType.BB_REFERENCE && value) {
@ -227,6 +232,16 @@ export async function outputProcessing<T extends Row[] | Row>(
} }
}) })
} }
} else if (column.type === FieldType.ATTACHMENT_SINGLE) {
for (let row of enriched) {
if (!row[property]) {
continue
}
if (!row[property].url) {
row[property].url = objectStore.getAppFileUrl(row[property].key)
}
}
} else if ( } else if (
!opts.skipBBReferences && !opts.skipBBReferences &&
column.type == FieldType.BB_REFERENCE column.type == FieldType.BB_REFERENCE