mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 02:16:05 +01:00 
			
		
		
		
	fix searchForNotes API method to look for archived notes as well
This commit is contained in:
		| @@ -92,13 +92,15 @@ function BackendScriptApi(currentNote, apiParams) { | ||||
|      * | ||||
|      * @method | ||||
|      * @param {string} query | ||||
|      * @param {SearchContext} [searchContext] | ||||
|      * @param {Object} [searchParams] | ||||
|      * @returns {Note[]} | ||||
|      */ | ||||
|     this.searchForNotes = (query, searchContext) => { | ||||
|         searchContext = searchContext || new SearchContext(); | ||||
|     this.searchForNotes = (query, searchParams = {}) => { | ||||
|         if (searchParams.includeArchivedNotes === undefined) { | ||||
|             searchParams.includeArchivedNotes = true; | ||||
|         } | ||||
|  | ||||
|         const noteIds = searchService.findNotesWithQuery(query, searchContext) | ||||
|         const noteIds = searchService.findNotesWithQuery(query, new SearchContext(searchParams)) | ||||
|             .map(sr => sr.noteId); | ||||
|  | ||||
|         return repository.getNotes(noteIds); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user