export type DeleteApiApiSongListsIdArgs = {id: number, notes?: string | undefined, hardDelete?: boolean | undefined}; export type DeleteApiApiSongListsIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * DELETE /api/songLists/{id} */ export const deleteApiApiSongListsId = async (args: DeleteApiApiSongListsIdArgs, options: DeleteApiApiSongListsIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.notes != null) query.append("notes", String(args.notes)) if (args.hardDelete != null) query.append("hardDelete", String(args.hardDelete)) const url = `${baseUrl.replace(/\/+$/, '')}/api/songLists/${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 undefined };