undelete note WIP

This commit is contained in:
zadam
2020-01-03 10:48:36 +01:00
parent 1d3608b7bf
commit c1d0a1e07b
13 changed files with 217 additions and 75 deletions

View File

@@ -55,12 +55,15 @@ async function deleteNote(req) {
const taskId = req.query.taskId;
const last = req.query.last === 'true';
// note how deleteId is separate from taskId - single taskId produces separate deleteId for each "top level" deleted note
const deleteId = utils.randomString(10);
const note = await repository.getNote(noteId);
const taskContext = TaskContext.getInstance(taskId, 'delete-notes');
for (const branch of await note.getBranches()) {
await noteService.deleteBranch(branch, taskContext);
await noteService.deleteBranch(branch, deleteId, taskContext);
}
if (last) {