aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/post-page
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-02-25 14:38:12 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-02-25 14:38:12 +0200
commiteab7b2108d91af1c905f795febf811d5cc404863 (patch)
tree968c641667d60532c0dbc97bd13d3284f3bbcdc6 /src/app/components/post-page
parenta7bf5cad6bf66f2cd7e12fc436410fafb7826b10 (diff)
downloadDevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.tar
DevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.tar.gz
DevHive-Angular-eab7b2108d91af1c905f795febf811d5cc404863.zip
Removed unnecessary variables from request subscriptions
Diffstat (limited to 'src/app/components/post-page')
-rw-r--r--src/app/components/post-page/post-page.component.ts9
1 files changed, 4 insertions, 5 deletions
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()]);
}
);