@ -25,8 +25,7 @@ export class Todo {
await ToDo.insert({task: req.body.task});
}
// this is how you can prevent the annoying double submit
await this.get(req, rep);
rep.code(200).send({message: "OK"});
@ -6,8 +6,7 @@
<script>
const new_task = async (todos, task) => {
// zero error handling but fine for now
await axios.post("/todo_alpine", {task});
return (await axios.post("/todo_alpine", {task})).data;
return (await axios.get('/todo_alpine')).data;
</script>