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