export type PatchApiApiV1WorkspacesSlugSavedViewsIdArgs = {id: string}; export type PatchApiApiV1WorkspacesSlugSavedViewsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * PATCH /api/v1/workspaces/{slug}/saved-views/{id} */ export const patchApiApiV1WorkspacesSlugSavedViewsId = async (args: PatchApiApiV1WorkspacesSlugSavedViewsIdArgs, options?: PatchApiApiV1WorkspacesSlugSavedViewsIdOptions) => { 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))}/saved-views/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };