mirror of
https://github.com/zadam/trilium.git
synced 2025-11-14 09:15:50 +01:00
search error handling & sanitize input for default fulltext
This commit is contained in:
@@ -80,12 +80,17 @@ async function doSearch(searchText) {
|
||||
return;
|
||||
}
|
||||
|
||||
const results = await server.get('search/' + encodeURIComponent(searchText));
|
||||
const response = await server.get('search/' + encodeURIComponent(searchText));
|
||||
|
||||
if (!response.success) {
|
||||
infoService.showError("Search failed.", 3000);
|
||||
return;
|
||||
}
|
||||
|
||||
$searchResultsInner.empty();
|
||||
$searchResults.show();
|
||||
|
||||
for (const result of results) {
|
||||
for (const result of response.results) {
|
||||
const link = $('<a>', {
|
||||
href: 'javascript:',
|
||||
text: result.title
|
||||
|
||||
Reference in New Issue
Block a user