mirror of
https://github.com/flarum/core.git
synced 2025-08-03 15:07:53 +02:00
Extract another variable
This commit is contained in:
@@ -57,13 +57,15 @@ class ApproveContent
|
|||||||
public function approveDiscussion(PostWasApproved $event)
|
public function approveDiscussion(PostWasApproved $event)
|
||||||
{
|
{
|
||||||
$post = $event->post;
|
$post = $event->post;
|
||||||
|
$discussion = $post->discussion;
|
||||||
|
|
||||||
$post->discussion->refreshCommentsCount();
|
$discussion->refreshCommentsCount();
|
||||||
$post->discussion->refreshLastPost();
|
$discussion->refreshLastPost();
|
||||||
|
|
||||||
if ($post->number == 1) {
|
if ($post->number == 1) {
|
||||||
$post->discussion->is_approved = true;
|
$discussion->is_approved = true;
|
||||||
}
|
}
|
||||||
$post->discussion->save();
|
|
||||||
|
$discussion->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user