From 807e72b990e7412bdf243095a07bd716bb93453f Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 14 Mar 2021 08:34:59 +0200 Subject: Updated comment and comment-page's subscriptions to use an observer object --- src/app/components/comment/comment.component.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/app/components/comment/comment.component.ts') diff --git a/src/app/components/comment/comment.component.ts b/src/app/components/comment/comment.component.ts index 5076769..d4dd9f4 100644 --- a/src/app/components/comment/comment.component.ts +++ b/src/app/components/comment/comment.component.ts @@ -25,23 +25,23 @@ export class CommentComponent implements OnInit { this.comment = this._commentService.getDefaultComment(); this.user = this._userService.getDefaultUser(); - this._commentService.getCommentRequest(Guid.parse(this.paramId)).subscribe( - (result: object) => { + this._commentService.getCommentRequest(Guid.parse(this.paramId)).subscribe({ + next: (result: object) => { Object.assign(this.comment, result); this.timeCreated = new Date(this.comment.timeCreated).toLocaleString('en-GB'); this.loadUser(); } - ); + }); } private loadUser(): void { - this._userService.getUserByUsernameRequest(this.comment.issuerUsername).subscribe( - (result: object) => { + this._userService.getUserByUsernameRequest(this.comment.issuerUsername).subscribe({ + next: (result: object) => { Object.assign(this.user, result); this.loaded = true; } - ); + }); } goToAuthorProfile(): void { -- cgit v1.2.3