Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
improved saving
zadame6183b9a1d2a
diff --git a/src/becca/entities/battachment.js b/src/becca/entities/battachment.jsindex 5f48761f9c..fd82ac9a54 100644--- a/src/becca/entities/battachment.js+++ b/src/becca/entities/battachment.js@@ -89,20 +89,18 @@ class BAttachment extends AbstractBeccaEntity {return {attachmentId: this.attachmentId,parentId: this.parentId,- name: this.name,+ role: this.role,mime: this.mime,+ title: this.title,isProtected: !!this.isProtected,- contentCheckSum: this.contentCheckSum, // FIXMEisDeleted: false,+ utcDateScheduledForDeletionSince: this.utcDateScheduledForDeletionSince,utcDateModified: this.utcDateModified};}getPojoToSave() {- const pojo = this.getPojo();- delete pojo.content; // not getting persisted-- return pojo;+ return this.getPojo();}}diff --git a/src/becca/entities/bnote.js b/src/becca/entities/bnote.jsindex 47ec911489..aa1be2577e 100644--- a/src/becca/entities/bnote.js+++ b/src/becca/entities/bnote.js@@ -1408,9 +1408,9 @@ class BNote extends AbstractBeccaEntity {? this.dateModified: contentMetadata.dateModified,dateCreated: dateUtils.localNowDateTime()- }, true).save();+ }, true);- noteRevision.setContent(content);+ noteRevision.setContent(content, { forceSave: true });return noteRevision;}diff --git a/src/becca/entities/bnote_revision.js b/src/becca/entities/bnote_revision.jsindex 6457a37da7..653069dce2 100644--- a/src/becca/entities/bnote_revision.js+++ b/src/becca/entities/bnote_revision.js@@ -106,14 +106,12 @@ class BNoteRevision extends AbstractBeccaEntity {utcDateLastEdited: this.utcDateLastEdited,utcDateCreated: this.utcDateCreated,utcDateModified: this.utcDateModified,- content: this.content, // used when retrieving full note revision to frontendcontentLength: this.contentLength};}getPojoToSave() {const pojo = this.getPojo();- delete pojo.content; // not getting persisteddelete pojo.contentLength; // not getting persistedif (pojo.isProtected) {