aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/register/register.component.ts
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:39:03 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:39:03 +0200
commit82594c050a9bbd1f527142ffe21e66c8c5f27ba3 (patch)
treefae4f372252e01864a8d43efe4e29280cc91dce5 /src/app/components/register/register.component.ts
parentc073a058bb7e97e6a9319e88f3f7765d4a466bd0 (diff)
downloadDevHive-Angular-82594c050a9bbd1f527142ffe21e66c8c5f27ba3.tar
DevHive-Angular-82594c050a9bbd1f527142ffe21e66c8c5f27ba3.tar.gz
DevHive-Angular-82594c050a9bbd1f527142ffe21e66c8c5f27ba3.zip
Updated login and register's subscriptions to use an observer object
Diffstat (limited to 'src/app/components/register/register.component.ts')
-rw-r--r--src/app/components/register/register.component.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/app/components/register/register.component.ts b/src/app/components/register/register.component.ts
index 36eaa55..e51a365 100644
--- a/src/app/components/register/register.component.ts
+++ b/src/app/components/register/register.component.ts
@@ -50,15 +50,15 @@ export class RegisterComponent implements OnInit {
}
onSubmit(): void {
- this._userService.registerUserRequest(this.registerUserFormGroup).subscribe(
- res => {
+ this._userService.registerUserRequest(this.registerUserFormGroup).subscribe({
+ next: (res: object) => {
this._tokenService.setUserTokenToSessionStorage(res);
this._router.navigate(['/']);
},
- (err: HttpErrorResponse) => {
+ error: (err: HttpErrorResponse) => {
this._errorBar.showError(err);
}
- );
+ });
}
onRedirectLogin(): void {
this._router.navigate(['/login']);