export type DeclineRequest = {supervisor_note: string, reviewer: string}; export type UpdateApiBusinessV2RequestsRequestIdDeclineArgs = {requestId: string, body: DeclineRequest}; export type UpdateApiBusinessV2RequestsRequestIdDeclineOptions = {baseUrl?: string | undefined, standardAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Decline Request * * PUT /business/v2/requests/{requestId}/decline */ export const updateApiBusinessV2RequestsRequestIdDecline = async (args: UpdateApiBusinessV2RequestsRequestIdDeclineArgs, options?: UpdateApiBusinessV2RequestsRequestIdDeclineOptions) => { const {baseUrl = "https://api.soldo.com", fetch: fetchFn = fetch, standardAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (standardAuth !== undefined) headers.set('authorization', `Bearer ${standardAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/business/v2/requests/${encodeURIComponent(String(args.requestId))}/decline${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };