[develop]: Role verification reload page instead of removing params.

This commit is contained in:
Konstantinos Triantafyllou 2024-04-08 17:14:00 +03:00
parent c69d1cd94d
commit 0111ea6681
1 changed files with 15 additions and 29 deletions

View File

@ -203,20 +203,13 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.clearCacheService.clearCache('Managers updated'); this.clearCacheService.clearCache('Managers updated');
this.managerModal.cancel(); this.managerModal.cancel();
this.error = null; this.error = null;
this.userManagementService.updateUserInfo(() => { if(this.service === "irish" || this.service === "monitor") {
if (this.paramsSubscription instanceof Subscription) { this.loading = false;
this.paramsSubscription.unsubscribe(); this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
} } else {
if(this.service === "irish") { this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager',
this.loading = false;
this.userManagementService.login(properties.domain + '/admin/' + this.verification.entity);
} else if (this.service === "monitor" ) {
this.loading = false;
this._router.navigate(['/admin/' + this.verification.entity]);
} else {
this.subscriptions.push(this.emailService.notifyManagers(this.id, 'manager',
Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => { Composer.composeEmailToInformOldManagersForTheNewOnes(this.name, this.id)).subscribe(() => {
this.subscriptions.push(this.emailService.notifyNewManager(Composer.composeEmailForNewManager(this.id, this.name)).subscribe( this.subscriptions.push(this.emailService.notifyNewManager(Composer.composeEmailForNewManager(this.id, this.name)).subscribe(
() => { () => {
this.loading = false; this.loading = false;
window.location.href = properties.adminPortalURL + '/' + this.verification.entity; window.location.href = properties.adminPortalURL + '/' + this.verification.entity;
@ -226,14 +219,13 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.loading = false; this.loading = false;
window.location.href = properties.adminPortalURL + '/' + this.verification.entity; window.location.href = properties.adminPortalURL + '/' + this.verification.entity;
} }
)); ));
}, error => { }, error => {
console.error(error); console.error(error);
this.loading = false; this.loading = false;
window.location.href = properties.adminPortalURL + '/' + this.verification.entity; window.location.href = properties.adminPortalURL + '/' + this.verification.entity;
})); }));
} }
});
}, error => { }, error => {
this.loading = false; this.loading = false;
this.error = 'The verification code is invalid'; this.error = 'The verification code is invalid';
@ -247,12 +239,7 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
this.memberModal.cancel(); this.memberModal.cancel();
this.loading = false; this.loading = false;
this.error = null; this.error = null;
this.userManagementService.updateUserInfo(() => { window.location.href = window.location.href.split('?')[0];
if (this.paramsSubscription instanceof Subscription) {
this.paramsSubscription.unsubscribe();
}
this.cancel();
});
}, error => { }, error => {
this.loading = false; this.loading = false;
this.error = 'The verification code is invalid'; this.error = 'The verification code is invalid';
@ -264,7 +251,6 @@ export class RoleVerificationComponent extends BaseComponent implements OnInit,
} }
cancel() { cancel() {
this._router.navigate([], {relativeTo: this.relativeTo}); this._router.navigate([]);
this.init();
} }
} }