diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-21 15:48:03 +0200 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-03-21 15:48:14 +0200 |
| commit | 0133f3b5e9086fba5006314c183451974d50502c (patch) | |
| tree | 96b4c9663b6eaacf064da902adff23fc2f3b837a /src/app/components/post-page/post-page.component.ts | |
| parent | 88b8336f0fa51a6f1ac1334e1237d1053d52d8a7 (diff) | |
| download | DevHive-Angular-0133f3b5e9086fba5006314c183451974d50502c.tar DevHive-Angular-0133f3b5e9086fba5006314c183451974d50502c.tar.gz DevHive-Angular-0133f3b5e9086fba5006314c183451974d50502c.zip | |
Major redesign of post page component and removed post edit and delete functionality, as well as old navbar from it
Diffstat (limited to 'src/app/components/post-page/post-page.component.ts')
| -rw-r--r-- | src/app/components/post-page/post-page.component.ts | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/app/components/post-page/post-page.component.ts b/src/app/components/post-page/post-page.component.ts index a60f4da..e159c69 100644 --- a/src/app/components/post-page/post-page.component.ts +++ b/src/app/components/post-page/post-page.component.ts @@ -87,48 +87,6 @@ export class PostPageComponent implements OnInit { } } - backToFeed(): void { - this._router.navigate(['/']); - } - - backToProfile(): void { - this._router.navigate(['/profile/' + this._tokenService.getUsernameFromSessionStorageToken()]); - } - - toLogin(): void { - this._router.navigate(['/login']); - } - - onFileUpload(event: any): void { - this.files.push(...event.target.files); - this.editPostFormGroup.get('fileUpload')?.reset(); - } - - removeAttachment(fileName: string): void { - this.files = this.files.filter(x => x.name !== fileName); - } - - editPost(): void { - if (this._tokenService.getTokenFromSessionStorage() === '') { - this.toLogin(); - return; - } - - if (this.editingPost) { - const newMessage = this.editPostFormGroup.get('newPostMessage')?.value; - - if (newMessage === '' && newMessage !== this.post.message) { - this._postService.putPostWithSessionStorageRequest(this.postId, newMessage, this.files).subscribe({ - next: () => { - this.reloadPage(); - } - }); - this.dataArrived = false; - } - } - this.editingPost = !this.editingPost; - } - addComment(): void { if (!this.loggedIn) { this._router.navigate(['/login']); @@ -146,14 +104,6 @@ export class PostPageComponent implements OnInit { } } - deletePost(): void { - this._postService.deletePostWithSessionStorage(this.postId).subscribe({ - next: () => { - this._router.navigate(['/profile/' + this._tokenService.getUsernameFromSessionStorageToken()]); - } - }); - } - private reloadPage(): void { this._router.routeReuseStrategy.shouldReuseRoute = () => false; this._router.onSameUrlNavigation = 'reload'; |
