aboutsummaryrefslogtreecommitdiff
path: root/src/app/components/comment/comment.component.ts
diff options
context:
space:
mode:
authorKamen Mladenov <kamen.d.mladenov@protonmail.com>2021-03-14 09:11:46 +0200
committerGitHub <noreply@github.com>2021-03-14 09:11:46 +0200
commitd2d4452bfa4861458bc0ba6a618c2a27decc8051 (patch)
tree4cb5a0352865cbab3c5ae93141be9b7b2dae53df /src/app/components/comment/comment.component.ts
parentd8ffe52b67e983b9b317b2e5dcb138ac996eaa31 (diff)
parente3a8875e64c25a6e46380c4d003beac5953fd3e9 (diff)
downloadDevHive-Angular-d2d4452bfa4861458bc0ba6a618c2a27decc8051.tar
DevHive-Angular-d2d4452bfa4861458bc0ba6a618c2a27decc8051.tar.gz
DevHive-Angular-d2d4452bfa4861458bc0ba6a618c2a27decc8051.zip
Merge pull request #1 from Team-Kaleidoscope/code-refactor
Code refactor
Diffstat (limited to 'src/app/components/comment/comment.component.ts')
-rw-r--r--src/app/components/comment/comment.component.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/app/components/comment/comment.component.ts b/src/app/components/comment/comment.component.ts
index 5076769..7da896d 100644
--- a/src/app/components/comment/comment.component.ts
+++ b/src/app/components/comment/comment.component.ts
@@ -3,8 +3,8 @@ import { Router } from '@angular/router';
import { Guid } from 'guid-typescript';
import { CommentService } from 'src/app/services/comment.service';
import { UserService } from 'src/app/services/user.service';
-import { Comment } from 'src/models/comment';
-import { User } from 'src/models/identity/user';
+import { Comment } from 'src/models/comment.model';
+import { User } from 'src/models/identity/user.model';
@Component({
selector: 'app-comment',
@@ -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 {