mirror of
https://github.com/zadam/trilium.git
synced 2025-01-16 03:58:53 +08:00
fix exporting root note, closes #1024
This commit is contained in:
parent
108afe8896
commit
fa5d982a55
2 changed files with 17 additions and 2 deletions
|
@ -162,6 +162,13 @@ function getNoteIdFromNotePath(notePath) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getNoteIdAndParentIdFromNotePath(notePath) {
|
function getNoteIdAndParentIdFromNotePath(notePath) {
|
||||||
|
if (notePath === 'root') {
|
||||||
|
return {
|
||||||
|
noteId: 'root',
|
||||||
|
parentNoteId: 'none'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let parentNoteId = 'root';
|
let parentNoteId = 'root';
|
||||||
let noteId = '';
|
let noteId = '';
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,14 @@ async function exportBranch(req, res) {
|
||||||
const {branchId, type, format, version, taskId} = req.params;
|
const {branchId, type, format, version, taskId} = req.params;
|
||||||
const branch = await repository.getBranch(branchId);
|
const branch = await repository.getBranch(branchId);
|
||||||
|
|
||||||
|
if (!branch) {
|
||||||
|
const message = `Cannot export branch ${branchId} since it does not exist.`;
|
||||||
|
log.error(message);
|
||||||
|
|
||||||
|
res.status(500).send(message);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const taskContext = new TaskContext(taskId, 'export');
|
const taskContext = new TaskContext(taskId, 'export');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue