fixed saved search refresh

This commit is contained in:
zadam
2020-12-17 21:19:52 +01:00
parent 053162fef2
commit f8089ba370
4 changed files with 15 additions and 19 deletions

View File

@@ -22,11 +22,12 @@ async function searchFromNote(req) {
return [400, `Note ${req.params.noteId} is not search note.`]
}
let searchString;
let searchResultNoteIds;
try {
const searchScript = note.getRelationValue('searchScript');
const searchString = note.getLabelValue('searchString');
searchString = note.getLabelValue('searchString');
if (searchScript) {
searchResultNoteIds = await searchFromRelation(note, 'searchScript');
@@ -60,6 +61,8 @@ async function searchFromNote(req) {
searchResultNoteIds = searchResultNoteIds.slice(0, 200);
}
console.log(`Search with query "${searchString}" with results: ${searchResultNoteIds}`);
return searchResultNoteIds;
}