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
server-ts: Refactor out abstract init in entities
Elian Doranf857b8a9bb9d
diff --git a/src/becca/entities/abstract_becca_entity.ts b/src/becca/entities/abstract_becca_entity.tsindex 0edcd04ea7..00bf78e80e 100644--- a/src/becca/entities/abstract_becca_entity.ts+++ b/src/becca/entities/abstract_becca_entity.ts@@ -92,7 +92,9 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {abstract getPojo(): {};- abstract init(): void;+ init() {+ // Do nothing by default, can be overriden in derived classes.+ }abstract updateFromRow(row: unknown): void;diff --git a/src/becca/entities/battachment.ts b/src/becca/entities/battachment.tsindex f70cff9e23..7b203839aa 100644--- a/src/becca/entities/battachment.ts+++ b/src/becca/entities/battachment.ts@@ -83,10 +83,6 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {this.contentLength = row.contentLength;}- init(): void {- // Do nothing.- }-copy(): BAttachment {return new BAttachment({ownerId: this.ownerId,diff --git a/src/becca/entities/bblob.ts b/src/becca/entities/bblob.tsindex cb2301a5ba..40d1c58850 100644--- a/src/becca/entities/bblob.ts+++ b/src/becca/entities/bblob.ts@@ -26,10 +26,6 @@ class BBlob extends AbstractBeccaEntity<BBlob> {this.utcDateModified = row.utcDateModified;}- init() {- // Nothing to do.- }-getPojo() {return {blobId: this.blobId,diff --git a/src/becca/entities/boption.ts b/src/becca/entities/boption.tsindex b06a234311..48abee024c 100644--- a/src/becca/entities/boption.ts+++ b/src/becca/entities/boption.ts@@ -32,10 +32,6 @@ class BOption extends AbstractBeccaEntity<BOption> {this.utcDateModified = row.utcDateModified;}- init(): void {- // Do nothing.- }-beforeSaving() {super.beforeSaving();diff --git a/src/becca/entities/brecent_note.ts b/src/becca/entities/brecent_note.tsindex da94feaa90..c19a836034 100644--- a/src/becca/entities/brecent_note.ts+++ b/src/becca/entities/brecent_note.ts@@ -29,10 +29,6 @@ class BRecentNote extends AbstractBeccaEntity<BRecentNote> {this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();}- init(): void {- // Do nothing.- }-getPojo() {return {noteId: this.noteId,diff --git a/src/becca/entities/brevision.ts b/src/becca/entities/brevision.tsindex 48d131f0ae..101506858b 100644--- a/src/becca/entities/brevision.ts+++ b/src/becca/entities/brevision.ts@@ -68,10 +68,6 @@ class BRevision extends AbstractBeccaEntity<BRevision> {this.contentLength = row.contentLength;}- init() {- // Do nothing.- }-getNote() {return becca.notes[this.noteId];}