mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
note type context submenu WIP
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const repository = require('./repository');
|
||||
const sql = require('./sql');
|
||||
const log = require('./log');
|
||||
const parseFilters = require('./parse_filters');
|
||||
const buildSearchQuery = require('./build_search_query');
|
||||
|
||||
@@ -8,7 +9,14 @@ async function searchForNotes(searchString) {
|
||||
|
||||
const {query, params} = buildSearchQuery(filters);
|
||||
|
||||
return await repository.getEntities(query, params);
|
||||
try {
|
||||
return await repository.getEntities(query, params);
|
||||
}
|
||||
catch (e) {
|
||||
log.error("Search failed for " + query);
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
async function searchForNoteIds(searchString) {
|
||||
@@ -16,7 +24,14 @@ async function searchForNoteIds(searchString) {
|
||||
|
||||
const {query, params} = buildSearchQuery(filters, 'notes.noteId');
|
||||
|
||||
return await sql.getColumn(query, params);
|
||||
try {
|
||||
return await sql.getColumn(query, params);
|
||||
}
|
||||
catch (e) {
|
||||
log.error("Search failed for " + query);
|
||||
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user