property UseAuthResult.authUpload

Works like authFetch for a multipart upload that shows progress, as the dump creation dialog's file upload does. It goes through XHR, since fetch reports nothing until the whole body is sent. It still answers a Response, so callers use expectOk as usual.

onProgress receives a fraction from 0 to 1, or null once the body is sent and the server is working, or when the length is unknown.

Type

(
url: string,
body: FormData,
onProgress: (fraction: number | null) => void,
method?: string
) => Promise<Response>

Usage

import { type UseAuthResult } from "src/hooks/auth/useAuth.ts";