From 4ddd346f9038c51054cfa3bc853634f0509eebfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adina=20=C8=9Aeudan?= Date: Thu, 13 Jan 2022 13:06:11 +0200 Subject: [PATCH] RED-3176: Fixed missing email in update profile request --- .../user-profile-screen.component.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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 = {