export type DeleteApiCommentCommentUuidOptions = {baseUrl: string, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Endpoint for deleting a comment * * DELETE /comment/{comment_uuid} */ export const deleteApiCommentCommentUuid = async (options: DeleteApiCommentCommentUuidOptions) => { const {baseUrl, fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikey !== undefined) headers.set("X-API-KEY", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/comment/${encodeURIComponent(String(args.comment_uuid))}${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 };