#37 Fix error in String to Role conversion

This commit is contained in:
Art
2021-09-27 22:01:05 +03:00
parent de952b2144
commit dd536c5bf1

View File

@ -205,6 +205,14 @@ export class UserComponent implements OnInit, OnDestroy {
onUpdateCurrentUser(user: User) {
this.currentUsername = this.authenticationService.getUserFromLocalStorage().username;
this.refreshing = true;
if (user.role == undefined) user.role = this.loggedInUser.role;
if (user.active == undefined) user.active = this.loggedInUser.active;
if (user.notLocked == undefined) user.notLocked = this.loggedInUser.notLocked;
console.log(user);
console.log(this.loggedInUser);
const formData = this.userService.createUserFormData(this.currentUsername, user, this.profileImage);
this.subs.sink = this.userService.updateUser(formData)
.subscribe(