mirror of
https://github.com/flarum/framework.git
synced 2024-11-26 10:14:16 +08:00
Performance: Load only basic information about post discussion/users
This commit is contained in:
parent
dedcbae359
commit
3c80612d80
|
@ -85,7 +85,7 @@ class PostSerializer extends PostBasicSerializer
|
|||
*/
|
||||
protected function discussion($post)
|
||||
{
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\DiscussionSerializer');
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\DiscussionBasicSerializer');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -93,7 +93,7 @@ class PostSerializer extends PostBasicSerializer
|
|||
*/
|
||||
protected function editUser($post)
|
||||
{
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\UserSerializer');
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\UserBasicSerializer');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -101,6 +101,6 @@ class PostSerializer extends PostBasicSerializer
|
|||
*/
|
||||
protected function hideUser($post)
|
||||
{
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\UserSerializer');
|
||||
return $this->hasOne($post, 'Flarum\Api\Serializer\UserBasicSerializer');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user