Skip to contentOpen History to see the last commit
api.ts
9 lines274 Bytes
1export const todosAPI = { 2 getTodos: (): Promise<Array<string>> => $fetch('/api/data'), 3 createTodo: async (add: string) => { 4 await $fetch('/api/data', { query: { add } }) 6 deleteTodos: async () => { 7 await $fetch('/api/data', { query: { clear: 1 } })