fix(todos): deleteTodo utilise handleResponse pour cohérence
This commit is contained in:
@@ -88,7 +88,7 @@ export async function updateTodo(id: string, data: TodoUpdate): Promise<Todo> {
|
||||
|
||||
export async function deleteTodo(id: string): Promise<void> {
|
||||
const res = await fetch(`${BASE}/${id}`, { method: 'DELETE' })
|
||||
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`)
|
||||
await handleResponse<void>(res)
|
||||
}
|
||||
|
||||
export async function postponeTodo(id: string, days: 1 | 7): Promise<Todo> {
|
||||
|
||||
Reference in New Issue
Block a user