Commit 701aa5ac by Muhammad Usman

redirect to dashboard after register

parent cfa9f946
......@@ -4,6 +4,8 @@ import { takeUntil } from 'rxjs/operators';
import { BaseComponent } from '../../base/base.component';
import { AuthService } from '../../services/auth.service';
import { HelperService } from '../../services/helper.service';
import { Router } from '@angular/router';
import { ToasterService } from '../../services/toaster.service';
@Component({
selector: 'app-register',
......@@ -30,7 +32,9 @@ export class RegisterComponent extends BaseComponent implements OnInit {
constructor(
private hs: HelperService,
private as: AuthService
private as: AuthService,
private ts: ToasterService,
private r: Router
) {
super();
}
......@@ -56,7 +60,8 @@ export class RegisterComponent extends BaseComponent implements OnInit {
this.isLoading = false;
this.hs.oneItHttpResponse(response);
if (response.registered) {
console.log('Registered');
this.ts.success('Registration successful');
this.r.navigate(['/my-career-web/dashboard']);
}
}, err => {
this.isLoading = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment