()
| 10 | |
| 11 | export const todoApi = { |
| 12 | async getAll(): Promise<Array<Todo>> { |
| 13 | const response = await fetch(`${BASE_URL}/api/todos`) |
| 14 | if (!response.ok) { |
| 15 | throw new Error(`Failed to fetch todos: ${response.status}`) |
| 16 | } |
| 17 | return response.json() |
| 18 | }, |
| 19 | |
| 20 | async create(data: { |
| 21 | id: string |