mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
search error handling & sanitize input for default fulltext
This commit is contained in:
@@ -9,7 +9,17 @@ const searchService = require('../../services/search');
|
||||
async function searchNotes(req) {
|
||||
const noteIds = await searchService.searchForNoteIds(req.params.searchString);
|
||||
|
||||
return noteIds.map(noteCacheService.getNotePath).filter(res => !!res);
|
||||
try {
|
||||
return {
|
||||
success: true,
|
||||
results: noteIds.map(noteCacheService.getNotePath).filter(res => !!res)
|
||||
}
|
||||
}
|
||||
catch {
|
||||
return {
|
||||
success: false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function searchFromNote(req) {
|
||||
|
||||
Reference in New Issue
Block a user