export type DeleteApiApiV1PlannedIdArgs = {id: string, Authorization: string}; export type DeleteApiApiV1PlannedIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete a Planned Card * * DELETE /api/v1/planned/{id} */ export const deleteApiApiV1PlannedId = async (args: DeleteApiApiV1PlannedIdArgs, options: DeleteApiApiV1PlannedIdOptions) => { 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/planned/${encodeURIComponent(String(args.id))}${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 (await res.json()) as unknown };