delete progress

This commit is contained in:
zadam
2019-10-18 23:19:16 +02:00
parent b890859025
commit 9f4ca279aa
7 changed files with 53 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ const sync_table = require('../../services/sync_table');
const tree = require('../../services/tree');
const notes = require('../../services/notes');
const repository = require('../../services/repository');
const TaskContext = require('../../services/task_context');
/**
* Code in this file deals with moving and cloning branches. Relationship between note and parent note is unique
@@ -101,9 +102,10 @@ async function setExpanded(req) {
async function deleteBranch(req) {
const branch = await repository.getBranch(req.params.branchId);
const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes');
return {
noteDeleted: await notes.deleteBranch(branch)
noteDeleted: await notes.deleteBranch(branch, taskContext)
};
}

View File

@@ -43,7 +43,7 @@ async function importToBranch(req) {
let note; // typically root of the import - client can show it after finishing the import
const taskContext = TaskContext.getInstance(taskId, options);
const taskContext = TaskContext.getInstance(taskId, 'import', options);
try {
if (extension === '.tar' && options.explodeArchives) {

View File

@@ -78,7 +78,7 @@ async function deleteNote(req) {
const note = await repository.getNote(noteId);
const taskContext = new TaskContext(utils.randomString(10), 'delete-note');
const taskContext = TaskContext.getInstance(req.query.taskId, 'delete-notes');
for (const branch of await note.getBranches()) {
await noteService.deleteBranch(branch, taskContext);