Add tests for featured thumbnail generation; apply Pint formatting and related edits
This commit is contained in:
@@ -12,6 +12,10 @@ use cPad\Plugins\News\Models\NewsArticle;
|
||||
|
||||
final class NewsArticleCommentService
|
||||
{
|
||||
public function __construct(private readonly NewsService $news)
|
||||
{
|
||||
}
|
||||
|
||||
public function create(NewsArticle $article, User $actor, string $body, ?NewsArticleComment $parent = null): NewsArticleComment
|
||||
{
|
||||
if (! $article->commentsAreEnabled()) {
|
||||
@@ -42,6 +46,8 @@ final class NewsArticleCommentService
|
||||
'status' => 'visible',
|
||||
]);
|
||||
|
||||
$this->news->invalidatePublicCache();
|
||||
|
||||
return $comment->fresh(['user.profile', 'replies.user.profile']);
|
||||
}
|
||||
|
||||
@@ -60,6 +66,8 @@ final class NewsArticleCommentService
|
||||
}
|
||||
|
||||
$comment->delete();
|
||||
|
||||
$this->news->invalidatePublicCache();
|
||||
}
|
||||
|
||||
private function canDelete(NewsArticleComment $comment, NewsArticle $article, User $actor): bool
|
||||
|
||||
Reference in New Issue
Block a user