[CST-6932] behavior on the registration page should be the same as the behavior on the change password page

This commit is contained in:
Sufiyan Shaikh
2022-09-27 13:23:13 +05:30
parent 064dae2581
commit a011c300aa

View File

@@ -41,6 +41,11 @@ export class CreateProfileComponent implements OnInit {
userInfoForm: FormGroup;
activeLangs: LangConfig[];
/**
* Prefix for the notification messages of this security form
*/
NOTIFICATIONS_PREFIX = 'register-page.create-profile.submit.';
constructor(
private translateService: TranslateService,
private ePersonDataService: EPersonDataService,
@@ -161,13 +166,12 @@ export class CreateProfileComponent implements OnInit {
getFirstCompletedRemoteData(),
).subscribe((rd: RemoteData<EPerson>) => {
if (rd.hasSucceeded) {
this.notificationsService.success(this.translateService.get('register-page.create-profile.submit.success.head'),
this.translateService.get('register-page.create-profile.submit.success.content'));
this.notificationsService.success(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.head'),
this.translateService.get(this.NOTIFICATIONS_PREFIX + 'success.content'));
this.store.dispatch(new AuthenticateAction(this.email, this.password));
this.router.navigate(['/home']);
} else {
this.notificationsService.error(this.translateService.get('register-page.create-profile.submit.error.head'),
this.translateService.get('register-page.create-profile.submit.error.content'));
this.notificationsService.error(this.translateService.get(this.NOTIFICATIONS_PREFIX + 'error.head'), rd.errorMessage);
}
});
}