From 9821c004ecdaebe326118935f3531ed1f3217a0a Mon Sep 17 00:00:00 2001 From: Jegor Date: Thu, 17 Jun 2021 10:30:40 +0200 Subject: [PATCH] wip: profile component --- .../registration/registration.component.ts | 2 +- .../components/profile/profile.component.ts | 4 +-- .../components/top-bar/top-bar.component.html | 2 +- .../components/top-bar/top-bar.component.ts | 33 +++++++++++-------- .../product-search-page.component.html | 3 +- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/Frontend/src/app/components/auth/registration/registration.component.ts b/Frontend/src/app/components/auth/registration/registration.component.ts index a624666..5324f72 100644 --- a/Frontend/src/app/components/auth/registration/registration.component.ts +++ b/Frontend/src/app/components/auth/registration/registration.component.ts @@ -36,8 +36,8 @@ export class RegistrationComponent implements OnInit { onSubmit() { this.api.registerUser(this.form.value.username, this.form.value.password, this.form.value.email).subscribe( res=> { - this.router.navigate(['']); this.api.saveSessionInfoToLocalStorage(res); + this.router.navigate(['/']); } ); } diff --git a/Frontend/src/app/components/profile/profile.component.ts b/Frontend/src/app/components/profile/profile.component.ts index 611e06a..5620827 100644 --- a/Frontend/src/app/components/profile/profile.component.ts +++ b/Frontend/src/app/components/profile/profile.component.ts @@ -11,7 +11,7 @@ export class ProfileComponent implements OnInit { currentUser: any; obj:any; alarms: any []; - productsMap: any; + productsMap: any = {}; constructor(private api: ApiService ) { } @@ -37,7 +37,7 @@ export class ProfileComponent implements OnInit { } getProductsByIds(): void { - let productIds: number []; + let productIds: number [] = []; this.alarms.forEach( alarm => {productIds.push(alarm.product_id)} ); diff --git a/Frontend/src/app/components/top-bar/top-bar.component.html b/Frontend/src/app/components/top-bar/top-bar.component.html index 944d654..2e3ebd8 100644 --- a/Frontend/src/app/components/top-bar/top-bar.component.html +++ b/Frontend/src/app/components/top-bar/top-bar.component.html @@ -2,7 +2,7 @@
Betterzon
- +