export type GetApiApiLotStandingsArgs = {bidder_id: string}; export type GetApiApiLotStandingsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Retrieve standings of individual bidders on lots. * * GET /api/lot_standings */ export const getApiApiLotStandings = async (args: GetApiApiLotStandingsArgs, options: GetApiApiLotStandingsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.bidder_id != null) query.append("bidder_id", String(args.bidder_id)) const url = `${baseUrl.replace(/\/+$/, '')}/api/lot_standings${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 };