From 8f9ae7e4d599b248e38c5d9e41e91af090a83605 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 19 Jan 2024 19:52:57 +0000 Subject: [PATCH] Clarify method name --- plugins/tiddlywiki/multiwikiserver/modules/init.js | 6 +++--- .../multiwikiserver/modules/sql-tiddler-store.js | 4 ++-- .../multiwikiserver/modules/tests-sql-tiddler-store.js | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/tiddlywiki/multiwikiserver/modules/init.js b/plugins/tiddlywiki/multiwikiserver/modules/init.js index 3750a6a15..492c743f9 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/init.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/init.js @@ -52,9 +52,9 @@ exports.startup = function() { $tw.sqlTiddlerStore.createRecipe("recipe-tau",["bag-alpha"]); $tw.sqlTiddlerStore.createRecipe("recipe-upsilon",["bag-alpha","bag-gamma","bag-beta"]); // Save tiddlers - $tw.sqlTiddlerStore.saveTiddler({title: "$:/SiteTitle",text: "Bag Alpha"},"bag-alpha"); - $tw.sqlTiddlerStore.saveTiddler({title: "$:/SiteTitle",text: "Bag Beta"},"bag-beta"); - $tw.sqlTiddlerStore.saveTiddler({title: "$:/SiteTitle",text: "Bag Gamma"},"bag-gamma"); + $tw.sqlTiddlerStore.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Alpha"},"bag-alpha"); + $tw.sqlTiddlerStore.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Beta"},"bag-beta"); + $tw.sqlTiddlerStore.saveBagTiddler({title: "$:/SiteTitle",text: "Bag Gamma"},"bag-gamma"); }; })(); diff --git a/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-store.js index 3651e78e4..475e9c6f6 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/sql-tiddler-store.js @@ -212,7 +212,7 @@ SqlTiddlerStore.prototype.createRecipe = function(recipename,bagnames) { }); }; -SqlTiddlerStore.prototype.saveTiddler = function(tiddlerFields,bagname) { +SqlTiddlerStore.prototype.saveBagTiddler = function(tiddlerFields,bagname) { // Update the tiddlers table this.runStatement(` INSERT OR REPLACE INTO tiddlers (bag_id, title) @@ -269,7 +269,7 @@ SqlTiddlerStore.prototype.saveRecipeTiddler = function(tiddlerFields,recipename) recipe_name: recipename }); // Save the tiddler to the topmost bag - this.saveTiddler(tiddlerFields,row.bag_name); + this.saveBagTiddler(tiddlerFields,row.bag_name); }; SqlTiddlerStore.prototype.deleteTiddler = function(title,bagname) { diff --git a/plugins/tiddlywiki/multiwikiserver/modules/tests-sql-tiddler-store.js b/plugins/tiddlywiki/multiwikiserver/modules/tests-sql-tiddler-store.js index 69cda1aab..8a4b13f49 100644 --- a/plugins/tiddlywiki/multiwikiserver/modules/tests-sql-tiddler-store.js +++ b/plugins/tiddlywiki/multiwikiserver/modules/tests-sql-tiddler-store.js @@ -37,10 +37,10 @@ describe("SQL tiddler store", function() { // Run tests it("should save and retrieve tiddlers", function() { // Save tiddlers - sqlTiddlerStore.saveTiddler({title: "Another Tiddler",text: "I'm in alpha",tags: "one two three"},"bag-alpha"); - sqlTiddlerStore.saveTiddler({title: "Hello There",text: "I'm in alpha as well",tags: "one two three"},"bag-alpha"); - sqlTiddlerStore.saveTiddler({title: "Hello There",text: "I'm in beta",tags: "four five six"},"bag-beta"); - sqlTiddlerStore.saveTiddler({title: "Hello There",text: "I'm in gamma",tags: "seven eight nine"},"bag-gamma"); + sqlTiddlerStore.saveBagTiddler({title: "Another Tiddler",text: "I'm in alpha",tags: "one two three"},"bag-alpha"); + sqlTiddlerStore.saveBagTiddler({title: "Hello There",text: "I'm in alpha as well",tags: "one two three"},"bag-alpha"); + sqlTiddlerStore.saveBagTiddler({title: "Hello There",text: "I'm in beta",tags: "four five six"},"bag-beta"); + sqlTiddlerStore.saveBagTiddler({title: "Hello There",text: "I'm in gamma",tags: "seven eight nine"},"bag-gamma"); // Verify what we've got expect(sqlTiddlerStore.getRecipeTiddlers("recipe-rho")).toEqual([ "Another Tiddler", "Hello There"]); expect(sqlTiddlerStore.getRecipeTiddlers("recipe-sigma")).toEqual([ "Another Tiddler", "Hello There"]);