From dd536c5bf120e156fb093210bf9ca488e6eb4d5a Mon Sep 17 00:00:00 2001 From: Art Date: Mon, 27 Sep 2021 22:01:05 +0300 Subject: [PATCH] #37 Fix error in String to Role conversion --- .../src/app/component/user/user.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/support-portal-frontend/src/app/component/user/user.component.ts b/support-portal-frontend/src/app/component/user/user.component.ts index 2361c1a..b353c1b 100644 --- a/support-portal-frontend/src/app/component/user/user.component.ts +++ b/support-portal-frontend/src/app/component/user/user.component.ts @@ -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(