improved saving attachment

This commit is contained in:
zadam
2023-03-16 16:37:31 +01:00
parent 2b84f1be00
commit d83005fe4d
6 changed files with 50 additions and 31 deletions

View File

@@ -158,8 +158,8 @@ function getAttachments(req) {
}
function saveAttachment(req) {
const {noteId, name} = req.params;
const {mime, content} = req.body;
const {noteId} = req.params;
const {attachmentId, role, mime, title, content} = req.body;
const note = becca.getNote(noteId);
@@ -167,7 +167,7 @@ function saveAttachment(req) {
throw new NotFoundError(`Note '${noteId}' doesn't exist.`);
}
note.saveAttachment(name, mime, content);
note.saveAttachment({attachmentId, role, mime, title, content});
}
function getRelationMap(req) {