export type GetApiFundableIndustrySearchArgs = {name: string, type?: string | undefined}; export type GetApiFundableIndustrySearchOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Search for industry permalinks to filter by * * GET /fundable/industry/search */ export const getApiFundableIndustrySearch = async (args: GetApiFundableIndustrySearchArgs, options?: GetApiFundableIndustrySearchOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.name != null) query.append("name", String(args.name)) if (args.type != null) query.append("type", String(args.type)) const url = `${baseUrl.replace(/\/+$/, '')}/fundable/industry/search${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 };