mirror of
https://github.com/zadam/trilium.git
synced 2025-11-18 03:00:41 +01:00
use standard search to find notes with same attrs
This commit is contained in:
@@ -258,14 +258,6 @@ async function deleteRelation(req) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getNotesWithAttribute(req) {
|
||||
const {type, name, value} = req.body;
|
||||
|
||||
const notes = await attributeService.getNotesWithAttribute(type, name, value);
|
||||
|
||||
return notes.map(note => note.noteId);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
updateNoteAttributes,
|
||||
updateNoteAttributes2,
|
||||
@@ -275,6 +267,5 @@ module.exports = {
|
||||
getValuesForAttribute,
|
||||
getEffectiveNoteAttributes,
|
||||
createRelation,
|
||||
deleteRelation,
|
||||
getNotesWithAttribute
|
||||
deleteRelation
|
||||
};
|
||||
|
||||
@@ -7,12 +7,13 @@ const scriptService = require('../../services/script');
|
||||
const searchService = require('../../services/search/search');
|
||||
|
||||
async function searchNotes(req) {
|
||||
const notePaths = await searchService.searchNotes(req.params.searchString);
|
||||
const {count, results} = await searchService.searchNotes(req.params.searchString);
|
||||
|
||||
try {
|
||||
return {
|
||||
success: true,
|
||||
results: notePaths
|
||||
count,
|
||||
results
|
||||
}
|
||||
}
|
||||
catch {
|
||||
|
||||
Reference in New Issue
Block a user