reordering authors

This commit is contained in:
lotte
2019-12-02 15:37:59 +01:00
parent 0048a97181
commit bc8e7d8fe6
16 changed files with 291 additions and 126 deletions

View File

@@ -130,7 +130,7 @@ export class RelationshipService extends DataService<Relationship> {
private removeRelationshipItemsFromCache(item) {
this.objectCache.remove(item.self);
this.requestService.removeByHrefSubstring(item.self);
this.requestService.removeByHrefSubstring(item.uuid);
combineLatest(
this.objectCache.hasBySelfLinkObservable(item.self),
this.requestService.hasByHrefObservable(item.self)
@@ -327,7 +327,6 @@ export class RelationshipService extends DataService<Relationship> {
}
return this.update(updatedRelationship);
}),
// skipWhile((relationshipRD: RemoteData<Relationship>) => !relationshipRD.isSuccessful)
tap((relationshipRD: RemoteData<Relationship>) => {
if (relationshipRD.hasSucceeded) {
this.removeRelationshipItemsFromCache(item1);
@@ -337,4 +336,20 @@ export class RelationshipService extends DataService<Relationship> {
)
}
public updatePlace(relationship: Relationship, newIndex: number, left: boolean): Observable<RemoteData<Relationship>> {
let updatedRelationship;
if (left) {
updatedRelationship = Object.assign(new Relationship(), relationship, { leftPlace: newIndex });
} else {
updatedRelationship = Object.assign(new Relationship(), relationship, { rightPlace: newIndex });
}
return this.update(updatedRelationship).pipe(
tap((relationshipRD: RemoteData<Relationship>) => {
if (relationshipRD.hasSucceeded) {
this.removeRelationshipItemsFromCacheByRelationship(relationship.id);
}
})
);
}
}