mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
improved saving
This commit is contained in:
parent
d83005fe4d
commit
e6183b9a1d
@ -89,20 +89,18 @@ class BAttachment extends AbstractBeccaEntity {
|
|||||||
return {
|
return {
|
||||||
attachmentId: this.attachmentId,
|
attachmentId: this.attachmentId,
|
||||||
parentId: this.parentId,
|
parentId: this.parentId,
|
||||||
name: this.name,
|
role: this.role,
|
||||||
mime: this.mime,
|
mime: this.mime,
|
||||||
|
title: this.title,
|
||||||
isProtected: !!this.isProtected,
|
isProtected: !!this.isProtected,
|
||||||
contentCheckSum: this.contentCheckSum, // FIXME
|
|
||||||
isDeleted: false,
|
isDeleted: false,
|
||||||
|
utcDateScheduledForDeletionSince: this.utcDateScheduledForDeletionSince,
|
||||||
utcDateModified: this.utcDateModified
|
utcDateModified: this.utcDateModified
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getPojoToSave() {
|
getPojoToSave() {
|
||||||
const pojo = this.getPojo();
|
return this.getPojo();
|
||||||
delete pojo.content; // not getting persisted
|
|
||||||
|
|
||||||
return pojo;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1408,9 +1408,9 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
? this.dateModified
|
? this.dateModified
|
||||||
: contentMetadata.dateModified,
|
: contentMetadata.dateModified,
|
||||||
dateCreated: dateUtils.localNowDateTime()
|
dateCreated: dateUtils.localNowDateTime()
|
||||||
}, true).save();
|
}, true);
|
||||||
|
|
||||||
noteRevision.setContent(content);
|
noteRevision.setContent(content, { forceSave: true });
|
||||||
|
|
||||||
return noteRevision;
|
return noteRevision;
|
||||||
}
|
}
|
||||||
|
@ -106,14 +106,12 @@ class BNoteRevision extends AbstractBeccaEntity {
|
|||||||
utcDateLastEdited: this.utcDateLastEdited,
|
utcDateLastEdited: this.utcDateLastEdited,
|
||||||
utcDateCreated: this.utcDateCreated,
|
utcDateCreated: this.utcDateCreated,
|
||||||
utcDateModified: this.utcDateModified,
|
utcDateModified: this.utcDateModified,
|
||||||
content: this.content, // used when retrieving full note revision to frontend
|
|
||||||
contentLength: this.contentLength
|
contentLength: this.contentLength
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getPojoToSave() {
|
getPojoToSave() {
|
||||||
const pojo = this.getPojo();
|
const pojo = this.getPojo();
|
||||||
delete pojo.content; // not getting persisted
|
|
||||||
delete pojo.contentLength; // not getting persisted
|
delete pojo.contentLength; // not getting persisted
|
||||||
|
|
||||||
if (pojo.isProtected) {
|
if (pojo.isProtected) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user