export type PatchApiApiV1CompleteIdArgs = {id: string, Authorization: string}; export type PatchApiApiV1CompleteIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Move a Card to Completed * * PATCH /api/v1/complete/{id} */ export const patchApiApiV1CompleteId = async (args: PatchApiApiV1CompleteIdArgs, options: PatchApiApiV1CompleteIdOptions) => { 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/complete/${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 };