improved saving

This commit is contained in:
zadam 2023-03-16 17:43:37 +01:00
parent d83005fe4d
commit e6183b9a1d
3 changed files with 6 additions and 10 deletions

View File

@ -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, // FIXME
isDeleted: false,
utcDateScheduledForDeletionSince: this.utcDateScheduledForDeletionSince,
utcDateModified: this.utcDateModified
};
}
getPojoToSave() {
const pojo = this.getPojo();
delete pojo.content; // not getting persisted
return pojo;
return this.getPojo();
}
}

View File

@ -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;
}

View File

@ -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 frontend
contentLength: this.contentLength
};
}
getPojoToSave() {
const pojo = this.getPojo();
delete pojo.content; // not getting persisted
delete pojo.contentLength; // not getting persisted
if (pojo.isProtected) {