Stop storing bag and revision details as tiddler fields

Instead we store them as dictionary tiddlers
This commit is contained in:
Jeremy Ruston
2024-03-20 19:22:12 +00:00
parent eaebeb87c9
commit 3aa5607a3a
6 changed files with 44 additions and 122 deletions

View File

@@ -86,15 +86,18 @@ Given tiddler fields, tiddler_id and a bag_name, return the tiddler fields after
- Apply the bag_name as the bag field
*/
SqlTiddlerStore.prototype.processOutgoingTiddler = function(tiddlerFields,tiddler_id,bag_name,attachment_blob) {
const fields = Object.assign({},tiddlerFields,{
revision: "" + tiddler_id,
bag: bag_name
});
if(attachment_blob !== null) {
delete fields.text;
fields._canonical_uri = `/bags/${encodeURIComponent(bag_name)}/tiddlers/${encodeURIComponent(tiddlerFields.title)}/blob`;
return $tw.utils.extend(
{},
tiddlerFields,
{
text: undefined,
_canonical_uri: `/bags/${encodeURIComponent(bag_name)}/tiddlers/${encodeURIComponent(tiddlerFields.title)}/blob`
}
);
} else {
return tiddlerFields;
}
return fields;
};
/*