|
|
|
@ -1580,8 +1580,9 @@ class BNote extends AbstractBeccaEntity {
|
|
|
|
dateCreated: dateUtils.localNowDateTime()
|
|
|
|
dateCreated: dateUtils.localNowDateTime()
|
|
|
|
}, true);
|
|
|
|
}, true);
|
|
|
|
|
|
|
|
|
|
|
|
revision.save(); // to generate revisionId which is then used to save attachments
|
|
|
|
revision.save(); // to generate revisionId, which is then used to save attachments
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.type === 'text') {
|
|
|
|
for (const noteAttachment of this.getAttachments()) {
|
|
|
|
for (const noteAttachment of this.getAttachments()) {
|
|
|
|
if (noteAttachment.utcDateScheduledForErasureSince) {
|
|
|
|
if (noteAttachment.utcDateScheduledForErasureSince) {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
@ -1589,13 +1590,14 @@ class BNote extends AbstractBeccaEntity {
|
|
|
|
|
|
|
|
|
|
|
|
const revisionAttachment = noteAttachment.copy();
|
|
|
|
const revisionAttachment = noteAttachment.copy();
|
|
|
|
revisionAttachment.parentId = revision.revisionId;
|
|
|
|
revisionAttachment.parentId = revision.revisionId;
|
|
|
|
revisionAttachment.setContent(noteAttachment.getContent(), { forceSave: true });
|
|
|
|
revisionAttachment.setContent(noteAttachment.getContent(), {forceSave: true});
|
|
|
|
|
|
|
|
|
|
|
|
// content is rewritten to point to the revision attachments
|
|
|
|
// content is rewritten to point to the revision attachments
|
|
|
|
noteContent = noteContent.replaceAll(`attachments/${noteAttachment.attachmentId}`, `attachments/${revisionAttachment.attachmentId}`);
|
|
|
|
noteContent = noteContent.replaceAll(`attachments/${noteAttachment.attachmentId}`, `attachments/${revisionAttachment.attachmentId}`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
revision.setContent(noteContent, { forceSave: true });
|
|
|
|
revision.setContent(noteContent, {forceSave: true});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return revision;
|
|
|
|
return revision;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|