option to erase notes immediately

This commit is contained in:
zadam
2021-09-16 14:38:09 +02:00
parent 9b9be5d155
commit 0448883782
10 changed files with 74 additions and 16 deletions

View File

@@ -63,6 +63,7 @@ function updateNote(req) {
function deleteNote(req) {
const noteId = req.params.noteId;
const taskId = req.query.taskId;
const eraseNotes = req.query.eraseNotes === 'true';
const last = req.query.last === 'true';
// note how deleteId is separate from taskId - single taskId produces separate deleteId for each "top level" deleted note
@@ -76,6 +77,10 @@ function deleteNote(req) {
noteService.deleteBranch(branch, deleteId, taskContext);
}
if (eraseNotes) {
noteService.eraseNotesWithDeleteId(deleteId);
}
if (last) {
taskContext.taskSucceeded();
}