mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01: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) { | 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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zadam
						zadam