mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
allow also deleting note when removing note from note relation
This commit is contained in:
@@ -66,6 +66,16 @@ async function updateNote(req) {
|
||||
await noteService.updateNote(noteId, note);
|
||||
}
|
||||
|
||||
async function deleteNote(req) {
|
||||
const noteId = req.params.noteId;
|
||||
|
||||
const note = await repository.getNote(noteId);
|
||||
|
||||
for (const branch of await note.getBranches()) {
|
||||
await noteService.deleteNote(branch);
|
||||
}
|
||||
}
|
||||
|
||||
async function sortNotes(req) {
|
||||
const noteId = req.params.noteId;
|
||||
|
||||
@@ -165,6 +175,7 @@ async function changeTitle(req) {
|
||||
module.exports = {
|
||||
getNote,
|
||||
updateNote,
|
||||
deleteNote,
|
||||
createNote,
|
||||
sortNotes,
|
||||
protectSubtree,
|
||||
|
||||
Reference in New Issue
Block a user