mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
20 lines
409 B
JavaScript
20 lines
409 B
JavaScript
"use strict";
|
|
|
|
const autocompleteService = require('../../services/note_cache');
|
|
|
|
async function getAutocomplete(req) {
|
|
const query = req.query.query;
|
|
|
|
const results = autocompleteService.findNotes(query);
|
|
|
|
return results.map(res => {
|
|
return {
|
|
value: res.title + ' (' + res.path + ')',
|
|
title: res.title
|
|
}
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
getAutocomplete
|
|
}; |