mirror of
https://github.com/flarum/core.git
synced 2025-10-11 06:54:26 +02:00
Performance: Assign parent discussion to posts so it doesn't have to be reloaded
This commit is contained in:
@@ -173,6 +173,12 @@ class ShowDiscussionController extends AbstractResourceController
|
||||
|
||||
$query->orderBy('time')->skip($offset)->take($limit)->with($include);
|
||||
|
||||
return $query->get()->all();
|
||||
$posts = $query->get()->all();
|
||||
|
||||
foreach ($posts as $post) {
|
||||
$post->discussion = $discussion;
|
||||
}
|
||||
|
||||
return $posts;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user