mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
22 lines
496 B
JavaScript
22 lines
496 B
JavaScript
"use strict";
|
|
|
|
const similarityService = require('../../becca/similarity');
|
|
const becca = require("../../becca/becca");
|
|
const NotFoundError = require("../../errors/not_found_error");
|
|
|
|
async function getSimilarNotes(req) {
|
|
const noteId = req.params.noteId;
|
|
|
|
const note = becca.getNote(noteId);
|
|
|
|
if (!note) {
|
|
throw new NotFoundError(`Note '${noteId}' not found.`);
|
|
}
|
|
|
|
return await similarityService.findSimilarNotes(noteId);
|
|
}
|
|
|
|
module.exports = {
|
|
getSimilarNotes
|
|
};
|