fix: resume legacy multipart uploads as jobs
This commit is contained in:
parent
b7d66da14b
commit
7f02d27911
1 changed files with 6 additions and 0 deletions
|
|
@ -200,6 +200,12 @@ export async function uploadFileMultipart(
|
|||
// Resume: reuse key + uploadId, skip parts that already have ETags.
|
||||
key = saved.key
|
||||
uploadId = saved.uploadId
|
||||
const { data: adopted } = await api.post<{ jobId: string }>(
|
||||
`/projects/${projectId}/uploads/multipart/adopt`,
|
||||
{ fileName: file.name, contentType: file.type || 'application/octet-stream', key, uploadId }
|
||||
)
|
||||
await saveUpload({ id: storeId, projectId, jobId: adopted.jobId, files: [file],
|
||||
createdAt: Date.now(), kind: 'zip', r2Key: key })
|
||||
} else {
|
||||
const { data } = await api.post<{ key: string; uploadId: string; jobId?: string }>(
|
||||
`/projects/${projectId}/uploads/multipart`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue