mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	fix exporting root note, closes #1024
This commit is contained in:
		
							parent
							
								
									108afe8896
								
							
						
					
					
						commit
						fa5d982a55
					
				@ -162,6 +162,13 @@ function getNoteIdFromNotePath(notePath) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getNoteIdAndParentIdFromNotePath(notePath) {
 | 
			
		||||
    if (notePath === 'root') {
 | 
			
		||||
        return {
 | 
			
		||||
            noteId: 'root',
 | 
			
		||||
            parentNoteId: 'none'
 | 
			
		||||
        };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    let parentNoteId = 'root';
 | 
			
		||||
    let noteId = '';
 | 
			
		||||
 | 
			
		||||
@ -286,4 +293,4 @@ export default {
 | 
			
		||||
    getNotePathTitle,
 | 
			
		||||
    getHashValueFromAddress,
 | 
			
		||||
    parseNotePath
 | 
			
		||||
};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,14 @@ async function exportBranch(req, res) {
 | 
			
		||||
    const {branchId, type, format, version, taskId} = req.params;
 | 
			
		||||
    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');
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
@ -39,4 +47,4 @@ async function exportBranch(req, res) {
 | 
			
		||||
 | 
			
		||||
module.exports = {
 | 
			
		||||
    exportBranch
 | 
			
		||||
};
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user