mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[UXP-10] compacting code
This commit is contained in:

committed by
Sufiyan Shaikh

parent
a3eb544422
commit
0783cd5cb6
@@ -92,8 +92,11 @@ export class RegisterEmailFormComponent implements OnInit {
|
||||
* Register an email address
|
||||
*/
|
||||
registeration(captchaToken) {
|
||||
let a = this.epersonRegistrationService.registerEmail(this.email.value);
|
||||
if (captchaToken) {
|
||||
this.epersonRegistrationService.registerEmail(this.email.value, captchaToken).subscribe((response: RemoteData<Registration>) => {
|
||||
a = this.epersonRegistrationService.registerEmail(this.email.value, captchaToken);
|
||||
}
|
||||
a.subscribe((response: RemoteData<Registration>) => {
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationService.success(this.translateService.get(`${this.MESSAGE_PREFIX}.success.head`),
|
||||
this.translateService.get(`${this.MESSAGE_PREFIX}.success.content`, {email: this.email.value}));
|
||||
@@ -103,18 +106,6 @@ export class RegisterEmailFormComponent implements OnInit {
|
||||
this.translateService.get(`${this.MESSAGE_PREFIX}.error.content`, {email: this.email.value}));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.epersonRegistrationService.registerEmail(this.email.value).subscribe((response: RemoteData<Registration>) => {
|
||||
if (response.hasSucceeded) {
|
||||
this.notificationService.success(this.translateService.get(`${this.MESSAGE_PREFIX}.success.head`),
|
||||
this.translateService.get(`${this.MESSAGE_PREFIX}.success.content`, {email: this.email.value}));
|
||||
this.router.navigate(['/home']);
|
||||
} else {
|
||||
this.notificationService.error(this.translateService.get(`${this.MESSAGE_PREFIX}.error.head`),
|
||||
this.translateService.get(`${this.MESSAGE_PREFIX}.error.content`, {email: this.email.value}));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
get email() {
|
||||
|
Reference in New Issue
Block a user