mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 20:06:08 +01:00 
			
		
		
		
	optimized edited notes on day query
This commit is contained in:
		@@ -115,12 +115,17 @@ async function getEditedNotesOnDate(req) {
 | 
				
			|||||||
    const date = utils.sanitizeSql(req.params.date);
 | 
					    const date = utils.sanitizeSql(req.params.date);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const notes = await repository.getEntities(`
 | 
					    const notes = await repository.getEntities(`
 | 
				
			||||||
        select distinct notes.*
 | 
					        SELECT notes.*
 | 
				
			||||||
        from notes
 | 
					        FROM notes
 | 
				
			||||||
        left join note_revisions using (noteId)
 | 
					        WHERE noteId IN (
 | 
				
			||||||
        where notes.dateCreated LIKE '${date}%'
 | 
					                SELECT noteId FROM notes 
 | 
				
			||||||
 | 
					                WHERE notes.dateCreated LIKE '${date}%' 
 | 
				
			||||||
                   OR notes.dateModified LIKE '${date}%'
 | 
					                   OR notes.dateModified LIKE '${date}%'
 | 
				
			||||||
           OR note_revisions.dateLastEdited LIKE '${date}%'`);
 | 
					            UNION ALL
 | 
				
			||||||
 | 
					                SELECT noteId FROM note_revisions
 | 
				
			||||||
 | 
					                WHERE note_revisions.dateLastEdited LIKE '${date}%'
 | 
				
			||||||
 | 
					        )
 | 
				
			||||||
 | 
					        ORDER BY isDeleted`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (const note of notes) {
 | 
					    for (const note of notes) {
 | 
				
			||||||
        const notePath = noteCacheService.getNotePath(note.noteId);
 | 
					        const notePath = noteCacheService.getNotePath(note.noteId);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user