export type GetApiApiPublicAcceptorsDepsArgs = {clubCode?: number | undefined}; export type GetApiApiPublicAcceptorsDepsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * getDepartments * * GET /api/public/acceptors/deps */ export const getApiApiPublicAcceptorsDeps = async (args: GetApiApiPublicAcceptorsDepsArgs, options: GetApiApiPublicAcceptorsDepsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.clubCode != null) query.append("clubCode", String(args.clubCode)) const url = `${baseUrl.replace(/\/+$/, '')}/api/public/acceptors/deps${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 res.blob() };