diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-25 14:38:12 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-02-25 14:38:12 +0200 |
| commit | eab7b2108d91af1c905f795febf811d5cc404863 (patch) | |
| tree | 968c641667d60532c0dbc97bd13d3284f3bbcdc6 /src/app/components/profile | |
| parent | a7bf5cad6bf66f2cd7e12fc436410fafb7826b10 (diff) | |
| download | DevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.tar DevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.tar.gz DevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.zip | |
Removed unnecessary variables from request subscriptions
Diffstat (limited to 'src/app/components/profile')
| -rw-r--r-- | src/app/components/profile/profile.component.ts | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/app/components/profile/profile.component.ts b/src/app/components/profile/profile.component.ts index bbf8585..eaa1bec 100644 --- a/src/app/components/profile/profile.component.ts +++ b/src/app/components/profile/profile.component.ts @@ -3,7 +3,6 @@ import { Router } from '@angular/router'; import { UserService } from 'src/app/services/user.service'; import { User } from 'src/models/identity/user'; import { AppConstants } from 'src/app/app-constants.module'; -import { HttpErrorResponse } from '@angular/common/http'; import { Location } from '@angular/common'; import { LanguageService } from 'src/app/services/language.service'; import { TechnologyService } from 'src/app/services/technology.service'; @@ -38,10 +37,6 @@ export class ProfileComponent implements OnInit { this._titleService.setTitle(this._title); } - private setDefaultUser(): void { - this.user = this._userService.getDefaultUser(); - } - ngOnInit(): void { this._urlUsername = this._router.url.substring(9); @@ -63,7 +58,7 @@ export class ProfileComponent implements OnInit { this.isAdminUser = this.user.roles.map(x => x.name).includes(AppConstants.ADMIN_ROLE_NAME); this.loadLanguages(); }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -102,7 +97,7 @@ export class ProfileComponent implements OnInit { this.userPosts.push(...resultArr); this.finishUserLoading(); }, - (err: HttpErrorResponse) => { + () => { this._currentPage = -1; this.finishUserLoading(); } @@ -126,7 +121,7 @@ export class ProfileComponent implements OnInit { } this.dataArrived = true; }, - (err: HttpErrorResponse) => { + () => { this.logout(); } ); @@ -175,10 +170,10 @@ export class ProfileComponent implements OnInit { } this._userService.putBareUserFromSessionStorageRequest(loggedInUser, this.updateFrienship.get('password')?.value).subscribe( - (resultUpdate: object) => { + () => { this.reloadPage(); }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/']); } ); |
