fix: persist multipart job id for resume

This commit is contained in:
hailt 2026-11-12 23:09:54 +07:00
parent b7118a7859
commit b7d66da14b

View file

@ -201,12 +201,14 @@ export async function uploadFileMultipart(
key = saved.key key = saved.key
uploadId = saved.uploadId uploadId = saved.uploadId
} else { } else {
const { data } = await api.post<{ key: string; uploadId: string }>( const { data } = await api.post<{ key: string; uploadId: string; jobId?: string }>(
`/projects/${projectId}/uploads/multipart`, `/projects/${projectId}/uploads/multipart`,
{ fileName: file.name, contentType: file.type || 'application/octet-stream' } { fileName: file.name, contentType: file.type || 'application/octet-stream' }
) )
key = data.key key = data.key
uploadId = data.uploadId uploadId = data.uploadId
await saveUpload({ id: storeId, projectId, jobId: data.jobId ?? '', files: [file],
createdAt: Date.now(), kind: 'zip', r2Key: key })
} }
const persist = () => { const persist = () => {
try { try {