fixes, allowing conversion of note into an attachment

This commit is contained in:
zadam
2023-05-02 22:46:39 +02:00
parent 330e7ac08e
commit 735ac55bb8
12 changed files with 139 additions and 54 deletions

View File

@@ -267,6 +267,19 @@ function forceSaveNoteRevision(req) {
note.saveNoteRevision();
}
function convertNoteToAttachment(req) {
const {noteId} = req.params;
const note = becca.getNote(noteId);
if (!note) {
throw new NotFoundError(`Note '${noteId}' not found.`);
}
return {
attachment: note.convertToParentAttachment({ force: true })
};
}
module.exports = {
getNote,
updateNoteData,
@@ -282,5 +295,6 @@ module.exports = {
eraseUnusedAttachmentsNow,
getDeleteNotesPreview,
uploadModifiedFile,
forceSaveNoteRevision
forceSaveNoteRevision,
convertNoteToAttachment
};