export type DeleteApiApiV1WorkspacesSlugFormsFoldersFolderIdArgs = {folderId: string}; export type DeleteApiApiV1WorkspacesSlugFormsFoldersFolderIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /api/v1/workspaces/{slug}/forms/folders/{folderId} */ export const deleteApiApiV1WorkspacesSlugFormsFoldersFolderId = async (args: DeleteApiApiV1WorkspacesSlugFormsFoldersFolderIdArgs, options?: DeleteApiApiV1WorkspacesSlugFormsFoldersFolderIdOptions) => { const {baseUrl = "https://api.trybrein.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/workspaces/${encodeURIComponent(String(args.slug))}/forms/folders/${encodeURIComponent(String(args.folderId))}${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 };