app.get("/getTodos",getTodos);axios.get("http://localhost:3000/getTodos").then(({ data })=>{setTasks(data);});
ADD TODO - Params: currentTask: string
app.post("/addTodo",addTodo);//axios.post("http://localhost:3000/addTodo",currentTask).then(({ data })=>{if(!!data){console.log("task added");}setCurrentTask("");}).then(()=>{// update tasksaxios.get("http://localhost:3000/getTodos").then(({ data })=>{setTasks(data);});});
UPDATE TASK NAME OR STATUS - Params: todo: ITodo
app.put("/updateTodo",updateTodo);//axios.put("http://localhost:3000/updateTodo",todo).then(({ data })=>{console.log("task updated");setCurrentTask("");}).then(()=>{// update tasksaxios.get("http://localhost:3000/getTodos").then(({ data })=>{setTasks(data);});});
DELETE TODO - Params: todo: ITodo
app.delete("/deleteTodo",deleteTodo);//axios.delete("http://localhost:3000/deleteTodo",todo).then(({ data })=>{}).then(()=>{// update tasksaxios.get("http://localhost:3000/getTodos").then(({ data })=>{setTasks(data);});});