mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 16:55:50 +01:00
refactoring
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const optionService = require('../../services/options');
|
||||
const log = require('../../services/log');
|
||||
const attributes = require('../../services/attributes');
|
||||
const searchService = require('../../services/search/services/search');
|
||||
|
||||
// options allowed to be updated directly in options dialog
|
||||
const ALLOWED_OPTIONS = new Set([
|
||||
@@ -91,8 +92,7 @@ function update(name, value) {
|
||||
}
|
||||
|
||||
function getUserThemes() {
|
||||
const notes = attributes.getNotesWithLabel('appTheme');
|
||||
|
||||
const notes = searchService.findNotes("#appTheme");
|
||||
const ret = [];
|
||||
|
||||
for (const note of notes) {
|
||||
|
||||
@@ -28,7 +28,7 @@ async function searchFromNoteInt(note) {
|
||||
fuzzyAttributeSearch: false
|
||||
});
|
||||
|
||||
searchResultNoteIds = searchService.findNotesWithQuery(searchString, searchContext)
|
||||
searchResultNoteIds = searchService.findResultsWithQuery(searchString, searchContext)
|
||||
.map(sr => sr.noteId);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ function quickSearch(req) {
|
||||
fuzzyAttributeSearch: false
|
||||
});
|
||||
|
||||
return searchService.findNotesWithQuery(searchString, searchContext)
|
||||
return searchService.findResultsWithQuery(searchString, searchContext)
|
||||
.map(sr => sr.noteId);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ function search(req) {
|
||||
ignoreHoistedNote: true
|
||||
});
|
||||
|
||||
return searchService.findNotesWithQuery(searchString, searchContext)
|
||||
return searchService.findResultsWithQuery(searchString, searchContext)
|
||||
.map(sr => sr.noteId);
|
||||
}
|
||||
|
||||
@@ -242,8 +242,8 @@ function getRelatedNotes(req) {
|
||||
fuzzyAttributeSearch: false
|
||||
};
|
||||
|
||||
const matchingNameAndValue = searchService.findNotesWithQuery(formatAttrForSearch(attr, true), new SearchContext(searchSettings));
|
||||
const matchingName = searchService.findNotesWithQuery(formatAttrForSearch(attr, false), new SearchContext(searchSettings));
|
||||
const matchingNameAndValue = searchService.findResultsWithQuery(formatAttrForSearch(attr, true), new SearchContext(searchSettings));
|
||||
const matchingName = searchService.findResultsWithQuery(formatAttrForSearch(attr, false), new SearchContext(searchSettings));
|
||||
|
||||
const results = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user