add frontend API method openTabWithNote, #1645

This commit is contained in:
zadam
2021-02-17 23:55:51 +01:00
parent 600a312b2a
commit 8e730c6ecf
24 changed files with 855 additions and 387 deletions

View File

@@ -120,13 +120,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);