fix saving mermaid attachment

This commit is contained in:
zadam
2023-01-24 23:09:00 +01:00
parent 3c57f08ef7
commit 0bfb2631df
4 changed files with 40 additions and 6 deletions

View File

@@ -127,6 +127,19 @@ function setNoteTypeMime(req) {
note.save();
}
function saveNoteAttachment(req) {
const {noteId, name} = req.params;
const {mime, content} = req.body;
const note = becca.getNote(noteId);
if (!note) {
throw new NotFoundError(`Note '${noteId}' doesn't exist.`);
}
note.saveNoteAttachment(name, mime, content);
}
function getRelationMap(req) {
const {relationMapNoteId, noteIds} = req.body;
@@ -340,5 +353,6 @@ module.exports = {
eraseDeletedNotesNow,
getDeleteNotesPreview,
uploadModifiedFile,
forceSaveNoteRevision
forceSaveNoteRevision,
saveNoteAttachment
};