Group/create => update UI userService with possible freshly created user

This commit is contained in:
Patrick Haßel 2024-11-07 14:35:50 +01:00
parent 530dcd2f04
commit 39456f83d0
2 changed files with 5 additions and 2 deletions

View File

@ -60,7 +60,7 @@ export class UserService {
this.subscribePush(UserLogoutEvent, _ => this.setUser(null));
}
private fetchUser() {
public fetchUser() {
this.api.getSingle(['User', 'whoAmI'], UserPrivate.fromJsonOrNull, user => this.setUser(user));
}

View File

@ -41,7 +41,10 @@ export class GroupService {
}
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 {