export type CreateApiToolsVolunteerPhotosApiDownloadOptions = {baseUrl?: string | undefined, Token?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download volunteer photos as a ZIP file. * * POST /tools/volunteer-photos/api/download/ */ export const createApiToolsVolunteerPhotosApiDownload = async (options?: CreateApiToolsVolunteerPhotosApiDownloadOptions) => { const {baseUrl = "https://crisiscleanup-3-api-production.up.railway.app", fetch: fetchFn = fetch, Token} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Token !== undefined) headers.set("Authorization", Token) const url = `${baseUrl.replace(/\/+$/, '')}/tools/volunteer-photos/api/download/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };