export type CreateApiOpsSellersReenableSellerIdArgs = {seller_id: string}; export type CreateApiOpsSellersReenableSellerIdOptions = {baseUrl?: string | undefined, OAuth2TopiHeaderAuthorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Re-enable a seller * * POST /ops/sellers/reenable/{seller_id} */ export const createApiOpsSellersReenableSellerId = async (args: CreateApiOpsSellersReenableSellerIdArgs, options?: CreateApiOpsSellersReenableSellerIdOptions) => { const {baseUrl = "https://api.topi-staging.eu", fetch: fetchFn = fetch, OAuth2TopiHeaderAuthorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2TopiHeaderAuthorization !== undefined) headers.set('authorization', `Bearer ${OAuth2TopiHeaderAuthorization}`) const url = `${baseUrl.replace(/\/+$/, '')}/ops/sellers/reenable/${encodeURIComponent(String(args.seller_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };