fix: use api.upload() for artefact file attachments
All checks were successful
Deploy / deploy (push) Successful in 12s

api.post() was setting Content-Type to application/json and JSON.stringifying
the FormData, which destroyed the file data and caused "Either file upload or
drive_url is required" error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
fahed
2026-02-24 14:10:41 +03:00
parent 01fdb93efd
commit 0c945405e3

View File

@@ -710,7 +710,7 @@ function ArtefactDetailPanel({ artefact, onClose, onUpdate, onDelete, projects =
try { try {
const formData = new FormData() const formData = new FormData()
formData.append('file', file) formData.append('file', file)
await api.post(`/artefacts/${artefact.Id}/versions/${selectedVersion.Id}/attachments`, formData) await api.upload(`/artefacts/${artefact.Id}/versions/${selectedVersion.Id}/attachments`, formData)
toast.success('File uploaded') toast.success('File uploaded')
loadVersionData(selectedVersion.Id) loadVersionData(selectedVersion.Id)
} catch (err) { } catch (err) {