fix correct number of related attributes

This commit is contained in:
zadam 2021-10-29 21:36:57 +02:00
parent ce57a13002
commit 9ce224d4c5

View File

@ -247,6 +247,12 @@ function getRelatedNotes(req) {
const allResults = matchingNameAndValue.concat(matchingName); const allResults = matchingNameAndValue.concat(matchingName);
const allResultNoteIds = new Set();
for (const record of allResults) {
allResultNoteIds.add(record.noteId);
}
for (const record of allResults) { for (const record of allResults) {
if (results.length >= 20) { if (results.length >= 20) {
break; break;
@ -260,7 +266,7 @@ function getRelatedNotes(req) {
} }
return { return {
count: allResults.length, count: allResultNoteIds.size,
results results
}; };
} }