mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 01:36:24 +01:00
fix inverse relation detection in relation maps
This commit is contained in:
@@ -139,7 +139,7 @@ function getRelationMap(req) {
|
||||
for (const note of notes) {
|
||||
resp.noteTitles[note.noteId] = note.title;
|
||||
|
||||
resp.relations = resp.relations.concat((note.getRelations())
|
||||
resp.relations = resp.relations.concat(note.getRelations()
|
||||
.filter(relation => noteIds.includes(relation.value))
|
||||
.map(relation => ({
|
||||
attributeId: relation.attributeId,
|
||||
@@ -149,8 +149,10 @@ function getRelationMap(req) {
|
||||
})));
|
||||
|
||||
for (const relationDefinition of note.getRelationDefinitions()) {
|
||||
if (relationDefinition.value.inverseRelation) {
|
||||
resp.inverseRelations[relationDefinition.name] = relationDefinition.value.inverseRelation;
|
||||
const def = relationDefinition.getDefinition();
|
||||
|
||||
if (def.inverseRelation) {
|
||||
resp.inverseRelations[relationDefinition.getDefinedName()] = def.inverseRelation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user