From 825378c2b61e19067ad204f86178ae1c8e483fae Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Fri, 23 Feb 2024 14:54:56 -0500 Subject: [PATCH] Simplify it a bit more by having POST return the todo list again. --- controllers/todo_alpine.js | 3 +-- templates/todo_alpine.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/controllers/todo_alpine.js b/controllers/todo_alpine.js index deebe44..80355f0 100644 --- a/controllers/todo_alpine.js +++ b/controllers/todo_alpine.js @@ -25,8 +25,7 @@ export class Todo { await ToDo.insert({task: req.body.task}); } - // this is how you can prevent the annoying double submit - rep.code(200).send({message: "OK"}); + await this.get(req, rep); } } diff --git a/templates/todo_alpine.html b/templates/todo_alpine.html index 9a95704..ba0241e 100644 --- a/templates/todo_alpine.html +++ b/templates/todo_alpine.html @@ -6,8 +6,7 @@