simplified updating note content

This commit is contained in:
zadam
2022-06-13 22:38:59 +02:00
parent 7edcd5d746
commit 4cec856e21
12 changed files with 23 additions and 51 deletions

View File

@@ -53,11 +53,11 @@ function createNote(req) {
};
}
function updateNote(req) {
const note = req.body;
const noteId = req.params.noteId;
function updateNoteContent(req) {
const {content} = req.body;
const {noteId} = req.params;
return noteService.updateNote(noteId, note);
return noteService.updateNoteContent(noteId, content);
}
function deleteNote(req) {
@@ -294,7 +294,7 @@ function uploadModifiedFile(req) {
log.info(`Updating note '${noteId}' with content from ${filePath}`);
noteRevisionService.createNoteRevision(note);
note.saveNoteRevision();
const fileContent = fs.readFileSync(filePath);
@@ -322,7 +322,7 @@ function getBacklinkCount(req) {
module.exports = {
getNote,
updateNote,
updateNoteContent,
deleteNote,
undeleteNote,
createNote,