export type DeleteApiApiV5TasksListsTasksListIdArgs = {tasks_list_id: number}; export type DeleteApiApiV5TasksListsTasksListIdOptions = {baseUrl?: string | undefined, RWAPIKeyHeader?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete tasks list * * DELETE /api/v5/tasks/lists/{tasks_list_id} */ export const deleteApiApiV5TasksListsTasksListId = async (args: DeleteApiApiV5TasksListsTasksListIdArgs, options?: DeleteApiApiV5TasksListsTasksListIdOptions) => { const {baseUrl = "https://api.pavlok.com", fetch: fetchFn = fetch, RWAPIKeyHeader} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (RWAPIKeyHeader !== undefined) headers.set("Authorization", RWAPIKeyHeader) const url = `${baseUrl.replace(/\/+$/, '')}/api/v5/tasks/lists/${encodeURIComponent(String(args.tasks_list_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 };