export type PatchApiApiV1PlanIdArgs = {id: string, Authorization: string}; export type PatchApiApiV1PlanIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Move a Card to Planned * * PATCH /api/v1/plan/{id} */ export const patchApiApiV1PlanId = async (args: PatchApiApiV1PlanIdArgs, options: PatchApiApiV1PlanIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/plan/${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 (await res.json()) as unknown };