diff --git a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts index 8c3d896bf..1f4ec6c23 100644 --- a/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts +++ b/apps/red-ui/src/app/modules/account/screens/user-profile/user-profile-screen/user-profile-screen.component.ts @@ -40,15 +40,6 @@ export class UserProfileScreenComponent implements OnInit { ); } - private _getForm(): FormGroup { - return this._formBuilder.group({ - email: [undefined, [Validators.required, Validators.email]], - firstName: [undefined], - lastName: [undefined], - language: [undefined], - }); - } - get languageChanged(): boolean { return this._profileModel['language'] !== this.form.get('language').value; } @@ -82,7 +73,7 @@ export class UserProfileScreenComponent implements OnInit { } if (this.profileChanged) { - const value = this.form.value as IProfile; + const value = this.form.getRawValue() as IProfile; delete value.language; await this._userService @@ -98,6 +89,15 @@ export class UserProfileScreenComponent implements OnInit { this._initializeForm(); } + private _getForm(): FormGroup { + return this._formBuilder.group({ + email: [undefined, [Validators.required, Validators.email]], + firstName: [undefined], + lastName: [undefined], + language: [undefined], + }); + } + private _initializeForm(): void { try { this._profileModel = {