2019-09-01 08:58:13 +02:00
|
|
|
"use strict";
|
|
|
|
|
2024-02-17 20:55:36 +02:00
|
|
|
const similarityService = require('../../becca/similarity');
|
2024-02-17 11:42:19 +02:00
|
|
|
const becca = require('../../becca/becca');
|
2019-09-01 08:58:13 +02:00
|
|
|
|
2020-09-10 21:01:46 +02:00
|
|
|
async function getSimilarNotes(req) {
|
2019-09-01 08:58:13 +02:00
|
|
|
const noteId = req.params.noteId;
|
|
|
|
|
2023-05-08 00:02:08 +02:00
|
|
|
const note = becca.getNoteOrThrow(noteId);
|
2019-09-01 08:58:13 +02:00
|
|
|
|
2020-09-15 22:46:51 +02:00
|
|
|
return await similarityService.findSimilarNotes(noteId);
|
2019-09-01 08:58:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
getSimilarNotes
|
2020-05-13 14:42:16 +02:00
|
|
|
};
|