export type GetApiFundableDealsIdArgs = {id: string}; export type GetApiFundableDealsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get funding round by id * * GET /fundable/deals/{id} */ export const getApiFundableDealsId = async (args: GetApiFundableDealsIdArgs, options?: GetApiFundableDealsIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.id != null) query.append("id", String(args.id)) const url = `${baseUrl.replace(/\/+$/, '')}/fundable/deals/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };