syncification

This commit is contained in:
zadam
2020-06-20 12:31:38 +02:00
parent 30062d687f
commit 88348c560c
97 changed files with 1673 additions and 1700 deletions

View File

@@ -3,16 +3,16 @@
const noteCacheService = require('../../services/note_cache/note_cache_service');
const repository = require('../../services/repository');
async function getSimilarNotes(req) {
function getSimilarNotes(req) {
const noteId = req.params.noteId;
const note = await repository.getNote(noteId);
const note = repository.getNote(noteId);
if (!note) {
return [404, `Note ${noteId} not found.`];
}
const results = await noteCacheService.findSimilarNotes(noteId);
const results = noteCacheService.findSimilarNotes(noteId);
return results
.filter(note => note.noteId !== noteId);