export type DeleteApiCasesTemplatesCaseTemplateIdArgs = {case_template_id: string, 'X-CSRF-Protection': boolean}; export type DeleteApiCasesTemplatesCaseTemplateIdOptions = {baseUrl: string, backendAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the case template * * DELETE /cases/templates/{case_template_id} */ export const deleteApiCasesTemplatesCaseTemplateId = async (args: DeleteApiCasesTemplatesCaseTemplateIdArgs, options: DeleteApiCasesTemplatesCaseTemplateIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, backendAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-CSRF-Protection'] != null) headers.set("X-CSRF-Protection", String(args['X-CSRF-Protection'])) if (backendAuth !== undefined) cookies.push("mtls-prd=" + encodeURIComponent(backendAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/cases/templates/${encodeURIComponent(String(args.case_template_id))}${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 };