mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Refactor out abstract init in entities
This commit is contained in:
parent
a354b54a08
commit
f857b8a9bb
@ -92,7 +92,9 @@ abstract class AbstractBeccaEntity<T extends AbstractBeccaEntity<T>> {
|
|||||||
|
|
||||||
abstract getPojo(): {};
|
abstract getPojo(): {};
|
||||||
|
|
||||||
abstract init(): void;
|
init() {
|
||||||
|
// Do nothing by default, can be overriden in derived classes.
|
||||||
|
}
|
||||||
|
|
||||||
abstract updateFromRow(row: unknown): void;
|
abstract updateFromRow(row: unknown): void;
|
||||||
|
|
||||||
|
@ -83,10 +83,6 @@ class BAttachment extends AbstractBeccaEntity<BAttachment> {
|
|||||||
this.contentLength = row.contentLength;
|
this.contentLength = row.contentLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
init(): void {
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
copy(): BAttachment {
|
copy(): BAttachment {
|
||||||
return new BAttachment({
|
return new BAttachment({
|
||||||
ownerId: this.ownerId,
|
ownerId: this.ownerId,
|
||||||
|
@ -26,10 +26,6 @@ class BBlob extends AbstractBeccaEntity<BBlob> {
|
|||||||
this.utcDateModified = row.utcDateModified;
|
this.utcDateModified = row.utcDateModified;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
|
||||||
// Nothing to do.
|
|
||||||
}
|
|
||||||
|
|
||||||
getPojo() {
|
getPojo() {
|
||||||
return {
|
return {
|
||||||
blobId: this.blobId,
|
blobId: this.blobId,
|
||||||
|
@ -32,10 +32,6 @@ class BOption extends AbstractBeccaEntity<BOption> {
|
|||||||
this.utcDateModified = row.utcDateModified;
|
this.utcDateModified = row.utcDateModified;
|
||||||
}
|
}
|
||||||
|
|
||||||
init(): void {
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeSaving() {
|
beforeSaving() {
|
||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
|
@ -29,10 +29,6 @@ class BRecentNote extends AbstractBeccaEntity<BRecentNote> {
|
|||||||
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
init(): void {
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
getPojo() {
|
getPojo() {
|
||||||
return {
|
return {
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
|
@ -68,10 +68,6 @@ class BRevision extends AbstractBeccaEntity<BRevision> {
|
|||||||
this.contentLength = row.contentLength;
|
this.contentLength = row.contentLength;
|
||||||
}
|
}
|
||||||
|
|
||||||
init() {
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
getNote() {
|
getNote() {
|
||||||
return becca.notes[this.noteId];
|
return becca.notes[this.noteId];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user