Skip to content

Commit 33cd16b

Browse files
committed
Comment response tweet_id add
1 parent a9231ef commit 33cd16b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

backend/app/Entity/Comment.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,9 @@ public function edit(string $text): void
7575

7676
$this->body = $text;
7777
}
78+
79+
public function getTweetId(): int
80+
{
81+
return $this->tweet_id;
82+
}
7883
}

backend/app/Http/Presenter/CommentAsArrayPresenter.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function present(Comment $comment): array
2222
'id' => $comment->getId(),
2323
'body' => $comment->getBody(),
2424
'author_id' => $comment->getAuthorId(),
25+
'tweet_id' => $comment->getTweetId(),
2526
'created_at' => $comment->getCreatedAt()->toDateTimeString(),
2627
'updated_at' => $comment->getUpdatedAt() ? $comment->getUpdatedAt()->toDateTimeString() : null,
2728
'author' => $this->userArrayPresenter->present($comment->author)

0 commit comments

Comments
 (0)