mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
adding missing .getPojo() to becca entities
This commit is contained in:
parent
9441cb177f
commit
84246fd197
@ -18,6 +18,14 @@ class ApiToken extends AbstractEntity {
|
|||||||
this.token = row.token;
|
this.token = row.token;
|
||||||
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPojo() {
|
||||||
|
return {
|
||||||
|
apiTokenId: this.apiTokenId,
|
||||||
|
token: this.token,
|
||||||
|
utcDateCreated: this.utcDateCreated
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = ApiToken;
|
module.exports = ApiToken;
|
||||||
|
@ -141,11 +141,24 @@ class NoteRevision extends AbstractEntity {
|
|||||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// cannot be static!
|
getPojo() {
|
||||||
updatePojo(pojo) {
|
const pojo = {
|
||||||
|
noteRevisionId: this.noteRevisionId,
|
||||||
|
noteId: this.noteId,
|
||||||
|
type: this.type,
|
||||||
|
mime: this.mime,
|
||||||
|
isProtected: this.isProtected,
|
||||||
|
title: this.title,
|
||||||
|
dateLastEdited: this.dateLastEdited,
|
||||||
|
dateCreated: this.dateCreated,
|
||||||
|
utcDateLastEdited: this.utcDateLastEdited,
|
||||||
|
utcDateCreated: this.utcDateCreated,
|
||||||
|
utcDateModified: this.utcDateModified
|
||||||
|
};
|
||||||
|
|
||||||
if (pojo.isProtected) {
|
if (pojo.isProtected) {
|
||||||
if (protectedSessionService.isProtectedSessionAvailable()) {
|
if (protectedSessionService.isProtectedSessionAvailable()) {
|
||||||
pojo.title = protectedSessionService.encrypt(pojo.title);
|
pojo.title = protectedSessionService.encrypt(this.title);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// updating protected note outside of protected session means we will keep original ciphertexts
|
// updating protected note outside of protected session means we will keep original ciphertexts
|
||||||
@ -153,7 +166,7 @@ class NoteRevision extends AbstractEntity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete pojo.content;
|
return pojo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,8 +26,17 @@ class Option extends AbstractEntity {
|
|||||||
super.beforeSaving();
|
super.beforeSaving();
|
||||||
|
|
||||||
this.utcDateModified = dateUtils.utcNowDateTime();
|
this.utcDateModified = dateUtils.utcNowDateTime();
|
||||||
// utcDateCreated is scheduled for removal so the value does not matter
|
}
|
||||||
this.utcDateCreated = dateUtils.utcNowDateTime();
|
|
||||||
|
getPojo() {
|
||||||
|
return {
|
||||||
|
name: this.name,
|
||||||
|
value: this.value,
|
||||||
|
isSynced: this.isSynced,
|
||||||
|
utcDateModified: this.utcDateModified,
|
||||||
|
// utcDateCreated is scheduled for removal so the value does not matter
|
||||||
|
utcDateCreated: dateUtils.utcNowDateTime()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,6 +17,14 @@ class RecentNote extends AbstractEntity {
|
|||||||
this.notePath = row.notePath;
|
this.notePath = row.notePath;
|
||||||
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPojo() {
|
||||||
|
return {
|
||||||
|
noteId: this.noteId,
|
||||||
|
notePath: this.notePath,
|
||||||
|
utcDateCreated: this.utcDateCreated
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = RecentNote;
|
module.exports = RecentNote;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user