mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	basic entity support with lazy loaded relations
This commit is contained in:
		
							
								
								
									
										15
									
								
								src/entities/note_tree.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/entities/note_tree.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
"use strict";
 | 
			
		||||
 | 
			
		||||
const Entity = require('./entity');
 | 
			
		||||
 | 
			
		||||
class NoteTree extends Entity {
 | 
			
		||||
    async getNote() {
 | 
			
		||||
        return this.sql.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND noteId = ?", [this.noteId]);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async getParentNote() {
 | 
			
		||||
        return this.sql.getEntity("SELECT * FROM note_tree WHERE isDeleted = 0 AND parentNoteId = ?", [this.parentNoteId]);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
module.exports = NoteTree;
 | 
			
		||||
		Reference in New Issue
	
	Block a user