export type DeleteApiV3BackofficeDesignIdPreviewArgs = {id: number, kind?: ('all' | 'main' | 'top' | 'side') | undefined}; export type DeleteApiV3BackofficeDesignIdPreviewOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the design previews * * DELETE /v3/backoffice/design/{id}/preview */ export const deleteApiV3BackofficeDesignIdPreview = async (args: DeleteApiV3BackofficeDesignIdPreviewArgs, options?: DeleteApiV3BackofficeDesignIdPreviewOptions) => { const {baseUrl = "https://api.rhinoartisan.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.kind != null) query.append("kind", String(args.kind)) if (ApiKeyAuth !== undefined) headers.set("apikey", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v3/backoffice/design/${encodeURIComponent(String(args.id))}/preview${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };