fix: support onUploadProgress in useUploadMediaMutation
SessionFormPage now passes { formData, onUploadProgress } to mutateAsync
for progress tracking. Update uploadMediaMutationFn to destructure the
object and forward onUploadProgress to apiUploadMedia; update apiUploadMedia
to accept and pass the callback to axios.
[batch-1-hotfix]
This commit is contained in:
@@ -46,5 +46,10 @@ export const apiGetRegistrationQuestionVideo = () =>
|
||||
// Media uploads (especially course videos) can legitimately take several
|
||||
// minutes on slower connections. Keep the normal API timeout short, but give
|
||||
// this endpoint enough time to complete the backend's 300 MB upload contract.
|
||||
export const apiUploadMedia = (formData) =>
|
||||
http.post(endpoints.uploadMedia, formData, { timeout: 10 * 60 * 1000 })
|
||||
// `onUploadProgress` is optional and forwarded straight to axios so callers
|
||||
// can render an upload progress bar (e.g. XHR progress events).
|
||||
export const apiUploadMedia = (formData, onUploadProgress) =>
|
||||
http.post(endpoints.uploadMedia, formData, {
|
||||
timeout: 10 * 60 * 1000,
|
||||
...(onUploadProgress ? { onUploadProgress } : {}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user