mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
delete progress
This commit is contained in:
@@ -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)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user