Allow uploading attachments through views

This commit is contained in:
Andrew Kingston 2025-03-05 16:49:24 +00:00
parent 99fc3420fd
commit fa3a8342dc
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -49,7 +49,11 @@
data.append("file", fileList[i])
}
try {
return await API.uploadAttachment(formContext?.dataSource?.tableId, data)
let sourceId = formContext?.dataSource?.tableId
if (formContext?.dataSource?.type === "viewV2") {
sourceId = formContext.dataSource.id
}
return await API.uploadAttachment(sourceId, data)
} catch (error) {
return []
}