mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	fix setNoteToParent API method, closes #360
This commit is contained in:
		
							parent
							
								
									1f853024ee
								
							
						
					
					
						commit
						596544eca3
					
				@ -160,7 +160,7 @@ async function createPromotedAttributeRow(definitionAttr, valueAttr) {
 | 
				
			|||||||
                $input.autocomplete({
 | 
					                $input.autocomplete({
 | 
				
			||||||
                    appendTo: document.querySelector('body'),
 | 
					                    appendTo: document.querySelector('body'),
 | 
				
			||||||
                    hint: false,
 | 
					                    hint: false,
 | 
				
			||||||
                    autoselect: true,
 | 
					                    autoselect: false,
 | 
				
			||||||
                    openOnFocus: true,
 | 
					                    openOnFocus: true,
 | 
				
			||||||
                    minLength: 0,
 | 
					                    minLength: 0,
 | 
				
			||||||
                    tabAutocomplete: false
 | 
					                    tabAutocomplete: false
 | 
				
			||||||
 | 
				
			|||||||
@ -113,8 +113,8 @@ async function sortNotesAlphabetically(parentNoteId) {
 | 
				
			|||||||
async function setNoteToParent(noteId, prefix, parentNoteId) {
 | 
					async function setNoteToParent(noteId, prefix, parentNoteId) {
 | 
				
			||||||
    const parentNote = await repository.getNote(parentNoteId);
 | 
					    const parentNote = await repository.getNote(parentNoteId);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (parentNote.isDeleted) {
 | 
					    if (parentNote && parentNote.isDeleted) {
 | 
				
			||||||
        throw new Error("Cannot move note to deleted parent note");
 | 
					        throw new Error(`Cannot move note to deleted parent note ${parentNoteId}`);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // case where there might be more such branches is ignored. It's expected there should be just one
 | 
					    // case where there might be more such branches is ignored. It's expected there should be just one
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user