mirror of
https://github.com/zadam/trilium.git
synced 2024-11-17 13:14:44 +08:00
20 lines
No EOL
403 B
JavaScript
20 lines
No EOL
403 B
JavaScript
"use strict";
|
|
|
|
const noteCacheService = require('../../services/note_cache');
|
|
|
|
async function getAutocomplete(req) {
|
|
const query = req.query.query;
|
|
|
|
const results = noteCacheService.findNotes(query);
|
|
|
|
return results.map(res => {
|
|
return {
|
|
value: res.title + ' (' + res.path + ')',
|
|
label: res.title
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
getAutocomplete
|
|
}; |