mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-06 15:47:43 +08:00
21 lines
455 B
JavaScript
21 lines
455 B
JavaScript
"use strict";
|
|
|
|
const similarityService = require('../../services/note_cache/similarity.js');
|
|
const repository = require('../../services/repository');
|
|
|
|
async function getSimilarNotes(req) {
|
|
const noteId = req.params.noteId;
|
|
|
|
const note = repository.getNote(noteId);
|
|
|
|
if (!note) {
|
|
return [404, `Note ${noteId} not found.`];
|
|
}
|
|
|
|
return await similarityService.findSimilarNotes(noteId);
|
|
}
|
|
|
|
module.exports = {
|
|
getSimilarNotes
|
|
};
|