in ui/src/app/configuration/security-configuration/edit-user-dialog/edit-user-dialog.component.ts [242:293]
save() {
this.registrationError = undefined;
if (this.editMode) {
if (this.isUserAccount) {
this.userService
.updateUser(this.clonedUser as UserAccount)
.subscribe(() => {
if (this.emailChanged) {
this.authService.logout();
this.close(false);
this.router.navigate(['login']);
} else {
this.close(true);
}
});
} else {
this.userService
.updateService(this.clonedUser as ServiceAccount)
.subscribe(() => {
this.close(true);
});
}
} else {
if (this.isUserAccount) {
this.userService
.createUser(this.clonedUser as UserAccount)
.subscribe(
() => {
this.close(true);
},
error => {
this.registrationError = error.error.notifications
? error.error.notifications[0].title
: 'Unknown error';
},
);
} else {
this.userService
.createServiceAccount(this.clonedUser as ServiceAccount)
.subscribe(
() => {
this.close(true);
},
error => {
this.registrationError = error.error.notifications
? error.error.notifications[0].title
: 'Unknown error';
},
);
}
}
}