export type GetApiPromoPromoDetailsArgs = {authorization: string, 'content-language': string, alias: string}; export type GetApiPromoPromoDetailsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * delete referral scheme by admin * * GET /promo/promoDetails */ export const getApiPromoPromoDetails = async (args: GetApiPromoPromoDetailsArgs, options?: GetApiPromoPromoDetailsOptions) => { const {baseUrl = "http://api.pickerexpress.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.authorization != null) headers.set("authorization", String(args.authorization)) if (args['content-language'] != null) headers.set("content-language", String(args['content-language'])) if (args.alias != null) query.append("alias", String(args.alias)) const url = `${baseUrl.replace(/\/+$/, '')}/promo/promoDetails${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() };