user profile reload page after save

This commit is contained in:
amentis 2024-05-15 13:22:17 +03:00
parent bd86747278
commit 87d6158647
1 changed files with 3 additions and 4 deletions

View File

@ -249,21 +249,20 @@ export class UserProfileComponent extends BaseComponent implements OnInit, OnDes
return; return;
} }
const formData = this.formService.getValue(this.formGroup.value) as UserPersist; const formData = this.formService.getValue(this.formGroup.value) as UserPersist;
formData.additionalInfo.organization.typeId = Guid.parse(this.referenceTypeService.getOrganizationReferenceType()); if (formData.additionalInfo.organization) formData.additionalInfo.organization.typeId = Guid.parse(this.referenceTypeService.getOrganizationReferenceType());
this.userService.persist(formData) this.userService.persist(formData)
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
x => { x => {
this.editMode = false; this.editMode = false;
this.languageService.changeLanguage(this.formGroup.get('additionalInfo').get('language').value); this.languageService.changeLanguage(this.formGroup.get('additionalInfo').get('language').value);
this.getOrRefreshData();
this.authService.refresh() this.authService.refresh()
.pipe(takeUntil(this._destroyed)) .pipe(takeUntil(this._destroyed))
.subscribe(result => { .subscribe(result => {
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
this.router.navigate(['/profile']); // this.router.navigate(['/profile']);
window.location.reload();
}); });
// .subscribe(result => window.location.reload());
}, },
error => this.onCallbackError(error)); error => this.onCallbackError(error));
} }