export type CreateApiAppYelpBusinessesBusinessRefListingUpdateArgs = {businessRef: string}; export type CreateApiAppYelpBusinessesBusinessRefListingUpdateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Submit a Yelp Data Ingestion listing update job * * POST /app/yelp/businesses/{businessRef}/listing-update */ export const createApiAppYelpBusinessesBusinessRefListingUpdate = async (args: CreateApiAppYelpBusinessesBusinessRefListingUpdateArgs, options: CreateApiAppYelpBusinessesBusinessRefListingUpdateOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/app/yelp/businesses/${encodeURIComponent(String(args.businessRef))}/listing-update${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 };