Group/create => update UI userService with possible freshly created user
This commit is contained in:
parent
530dcd2f04
commit
39456f83d0
@ -60,7 +60,7 @@ export class UserService {
|
|||||||
this.subscribePush(UserLogoutEvent, _ => this.setUser(null));
|
this.subscribePush(UserLogoutEvent, _ => this.setUser(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
private fetchUser() {
|
public fetchUser() {
|
||||||
this.api.getSingle(['User', 'whoAmI'], UserPrivate.fromJsonOrNull, user => this.setUser(user));
|
this.api.getSingle(['User', 'whoAmI'], UserPrivate.fromJsonOrNull, user => this.setUser(user));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,10 @@ export class GroupService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
create(next: Next<Group>): void {
|
create(next: Next<Group>): void {
|
||||||
this.api.getSingle(['Group', 'create'], Group.fromJson, next);
|
this.api.getSingle(['Group', 'create'], Group.fromJson, group => {
|
||||||
|
this.userService.fetchUser(); // to update userService with possible freshly created user
|
||||||
|
next(group);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
changeTitle(group: Group, title: string, next?: Next<Group>): void {
|
changeTitle(group: Group, title: string, next?: Next<Group>): void {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user