aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/post/post.component.ts
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:41:52 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-03-14 08:41:52 +0200
commit065bfead76fc9e94c8344d812ee7f5b214c74321 (patch)
tree997d75eec34baf7bedc09932851425ff0bfac752 /src/app/components/post/post.component.ts
parent82594c050a9bbd1f527142ffe21e66c8c5f27ba3 (diff)
downloadDevHive-Angular-065bfead76fc9e94c8344d812ee7f5b214c74321.tar
DevHive-Angular-065bfead76fc9e94c8344d812ee7f5b214c74321.tar.gz
DevHive-Angular-065bfead76fc9e94c8344d812ee7f5b214c74321.zip
Update post and post-page's subscriptions to use an observer object
Diffstat (limited to 'src/app/components/post/post.component.ts')
-rw-r--r--src/app/components/post/post.component.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts
index 387f56f..a46811d 100644
--- a/src/app/components/post/post.component.ts
+++ b/src/app/components/post/post.component.ts
@@ -26,8 +26,8 @@ export class PostComponent implements OnInit {
this.post = this._postService.getDefaultPost();
this.user = this._userService.getDefaultUser();
- this._postService.getPostRequest(Guid.parse(this.paramId)).subscribe(
- (result: object) => {
+ this._postService.getPostRequest(Guid.parse(this.paramId)).subscribe({
+ next: (result: object) => {
Object.assign(this.post, result);
this.post.fileURLs = Object.values(result)[7];
this.votesNumber = 23;
@@ -35,16 +35,16 @@ export class PostComponent implements OnInit {
this.timeCreated = new Date(this.post.timeCreated).toLocaleString('en-GB');
this.loadUser();
}
- );
+ });
}
private loadUser(): void {
- this._userService.getUserByUsernameRequest(this.post.creatorUsername).subscribe(
- (result: object) => {
+ this._userService.getUserByUsernameRequest(this.post.creatorUsername).subscribe({
+ next: (result: object) => {
Object.assign(this.user, result);
this.loaded = true;
}
- );
+ });
}
goToAuthorProfile(): void {