export type DeleteApiBoardsBoardIDArgs = {boardID: string}; export type DeleteApiBoardsBoardIDOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Removes a board * * DELETE /boards/{boardID} */ export const deleteApiBoardsBoardID = async (args: DeleteApiBoardsBoardIDArgs, options?: DeleteApiBoardsBoardIDOptions) => { const {baseUrl = "http://localhost/api/v2", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/boards/${encodeURIComponent(String(args.boardID))}${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 };