export type CreateApiAuthoringV1SitesSiteIdCancelArgs = {'site-id': string}; export type CreateApiAuthoringV1SitesSiteIdCancelOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Cancel the draft site metadata undoing any modifications. * * POST /authoring/v1/sites/{site-id}/cancel */ export const createApiAuthoringV1SitesSiteIdCancel = async (args: CreateApiAuthoringV1SitesSiteIdCancelArgs, options: CreateApiAuthoringV1SitesSiteIdCancelOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/authoring/v1/sites/${encodeURIComponent(String(args['site-id']))}/cancel${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 };