From e59eba90863907abe0a1b7d91b7ec534a3aecde8 Mon Sep 17 00:00:00 2001 From: Thomas E Tuoti Date: Wed, 18 Dec 2024 10:22:20 -0700 Subject: [PATCH] Refactor DELETE operations into separate handlers AND add POST-to-DELETE mapping to mws-server --- .../multiwikiserver/modules/mws-server.js | 56 ++++++++------ .../modules/routes/handlers/delete-bag.js | 48 ++++++++++++ .../modules/routes/handlers/delete-recipe.js | 48 ++++++++++++ .../modules/routes/handlers/post-bag.js | 67 +++++----------- .../modules/routes/handlers/post-recipe.js | 76 ++++++------------- .../multiwikiserver/templates/get-index.tid | 15 ++-- 6 files changed, 178 insertions(+), 132 deletions(-) create mode 100644 plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/delete-bag.js create mode 100644 plugins/tiddlywiki/multiwikiserver/modules/routes/handlers/delete-recipe.js diff --git a/plugins/tiddlywiki/multiwikiserver/modules/mws-server.js b/plugins/tiddlywiki/multiwikiserver/modules/mws-server.js index be46a53d2..1209100dd 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/mws-server.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/mws-server.js @@ -317,31 +317,37 @@ Server.prototype.addAuthenticator = function(AuthenticatorClass) { }; Server.prototype.findMatchingRoute = function(request,state) { - for(var t=0; tjsonget[description]] }}}/>
-
+ jsonget[recipe_name]addprefix[/recipes/]] }}} method="post" onsubmit="return confirmRecipeDelete(this)"> - jsonget[recipe_name]] }}}/> - jsonget[bag_names]join[ ]] }}}/>
@@ -142,12 +140,11 @@ title: $:/plugins/tiddlywiki/multiwikiserver/templates/get-index <$transclude $variable="bagPill"/> <$text text={{{ [jsonget[description]] }}}/>
-
- - jsonget[bag_name]] }}}/> - -
-
+
jsonget[bag_name]addprefix[/bags/]] }}} method="post" onsubmit="return confirmBagDelete(this)"> + + +
+