From eab7b2108d91af1c905f795febf811d5cc404863 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 25 Feb 2021 14:38:12 +0200 Subject: Removed unnecessary variables from request subscriptions --- src/app/components/post-page/post-page.component.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/app/components/post-page/post-page.component.ts') diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index 3218a19..1ac89f4 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -1,4 +1,3 @@ -import { HttpErrorResponse } from '@angular/common/http'; import { Component, OnInit } from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { Title } from '@angular/platform-browser'; @@ -53,7 +52,7 @@ export class PostPageComponent implements OnInit { this.dataArrived = true; } }, - (err: HttpErrorResponse) => { + () => { this._router.navigate(['/not-found']); } ); @@ -120,7 +119,7 @@ export class PostPageComponent implements OnInit { if (newMessage === '' && newMessage !== this.post.message) { this._postService.putPostWithSessionStorageRequest(this.postId, newMessage, this.files).subscribe( - (result: object) => { + () => { this.reloadPage(); } ); @@ -139,7 +138,7 @@ export class PostPageComponent implements OnInit { const newComment = this.addCommentFormGroup.get('newComment')?.value; if (newComment !== '' && newComment !== null) { this._commentService.createCommentWithSessionStorageRequest(this.postId, newComment).subscribe( - (result: object) => { + () => { this.editPostFormGroup.reset(); this.reloadPage(); } @@ -149,7 +148,7 @@ export class PostPageComponent implements OnInit { deletePost(): void { this._postService.deletePostWithSessionStorage(this.postId).subscribe( - (result: object) => { + () => { this._router.navigate(['/profile/' + this._tokenService.getUsernameFromSessionStorageToken()]); } ); -- cgit v1.2.3