fixes to delete notifications

This commit is contained in:
zadam
2019-10-19 00:11:07 +02:00
parent 9f4ca279aa
commit 82bbf4173b
8 changed files with 50 additions and 15 deletions

View File

@@ -75,14 +75,20 @@ async function updateNote(req) {
async function deleteNote(req) {
const noteId = req.params.noteId;
const taskId = req.query.taskId;
const last = req.query.last === 'true';
const note = await repository.getNote(noteId);
const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes');
const taskContext = TaskContext.getInstance(taskId, 'delete-notes');
for (const branch of await note.getBranches()) {
await noteService.deleteBranch(branch, taskContext);
}
if (last) {
await taskContext.taskSucceeded();
}
}
async function sortNotes(req) {