mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 02:24:11 +00:00
[CST-4504] Bug fixing
This commit is contained in:
@@ -230,17 +230,22 @@ export class EditRelationshipListComponent implements OnInit, OnDestroy {
|
|||||||
modalComp.toRemove.splice(foundIndex,1);
|
modalComp.toRemove.splice(foundIndex,1);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.getIsRelatedItem(relatedItem)
|
this.getRelationFromId(relatedItem)
|
||||||
.subscribe((isRelated: boolean) => {
|
.subscribe((relationship: Relationship) => {
|
||||||
if (!isRelated ) {
|
if (!relationship ) {
|
||||||
modalComp.toAdd.push(searchResult);
|
modalComp.toAdd.push(searchResult);
|
||||||
|
} else {
|
||||||
|
const foundIndexRemove = modalComp.toRemove.findIndex( el => el.indexableObject.uuid === relatedItem.uuid);
|
||||||
|
if (foundIndexRemove !== -1) {
|
||||||
|
modalComp.toRemove.splice(foundIndexRemove,1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading$.next(true);
|
this.loading$.next(true);
|
||||||
// emit the last page again to trigger a fieldupdates refresh
|
// emit the last page again to trigger a fieldupdates refresh
|
||||||
this.relationshipsRd$.next(this.relationshipsRd$.getValue());
|
this.relationshipsRd$.next(this.relationshipsRd$.getValue());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
modalComp.deselect = (...selectableObjects: SearchResult<Item>[]) => {
|
modalComp.deselect = (...selectableObjects: SearchResult<Item>[]) => {
|
||||||
|
Reference in New Issue
Block a user