mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	change in naming of SQL methods
added assert methods to note tree
This commit is contained in:
		@@ -21,7 +21,7 @@ router.get('/:directory/to/:parentNoteId', auth.checkApiAuth, async (req, res, n
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
async function importNotes(dir, parentNoteId) {
 | 
			
		||||
    const parent = await sql.getSingleResult("SELECT * FROM notes WHERE note_id = ?", [parentNoteId]);
 | 
			
		||||
    const parent = await sql.getFirst("SELECT * FROM notes WHERE note_id = ?", [parentNoteId]);
 | 
			
		||||
 | 
			
		||||
    if (!parent) {
 | 
			
		||||
        return;
 | 
			
		||||
@@ -51,7 +51,7 @@ async function importNotes(dir, parentNoteId) {
 | 
			
		||||
            noteTitle = match[2];
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            let maxPos = await sql.getSingleValue("SELECT MAX(note_position) FROM notes_tree WHERE parent_note_id = ? AND is_deleted = 0", [parentNoteId]);
 | 
			
		||||
            let maxPos = await sql.getFirstValue("SELECT MAX(note_position) FROM notes_tree WHERE parent_note_id = ? AND is_deleted = 0", [parentNoteId]);
 | 
			
		||||
            if (maxPos) {
 | 
			
		||||
                notePos = maxPos + 1;
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user