moving from inherited attribute queries to owned one where it makes sense

This commit is contained in:
zadam
2019-12-01 11:10:04 +01:00
parent ba8a8dca7b
commit d9b9d730bb
10 changed files with 26 additions and 37 deletions

View File

@@ -27,7 +27,7 @@ eventService.subscribe(eventService.NOTE_TITLE_CHANGED, async note => {
const parents = await note.getParentNotes();
for (const parent of parents) {
if (await parent.hasLabel("sorted")) {
if (await parent.hasOwnedLabel("sorted")) {
await treeService.sortNotesAlphabetically(parent.noteId);
}
}
@@ -119,7 +119,7 @@ eventService.subscribe(eventService.ENTITY_CHANGED, async ({ entityName, entity
eventService.subscribe(eventService.ENTITY_DELETED, async ({ entityName, entity }) => {
await processInverseRelations(entityName, entity, async (definition, note, targetNote) => {
// if one inverse attribute is deleted then the other should be deleted as well
const relations = await targetNote.getRelations(definition.inverseRelation);
const relations = await targetNote.getOwnedRelations(definition.inverseRelation);
let deletedSomething = false;
for (const relation of relations) {