forked from mirror/pixelfed
Update StatusTransformer, fix missing tags attribute
This commit is contained in:
parent
955696b8a0
commit
dac326e949
2 changed files with 16 additions and 0 deletions
|
@ -15,6 +15,7 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
|||
{
|
||||
protected $defaultIncludes = [
|
||||
'account',
|
||||
'tags',
|
||||
'media_attachments',
|
||||
];
|
||||
|
||||
|
@ -72,6 +73,13 @@ class StatusStatelessTransformer extends Fractal\TransformerAbstract
|
|||
return $this->item($account, new AccountTransformer());
|
||||
}
|
||||
|
||||
public function includeTags(Status $status)
|
||||
{
|
||||
$tags = $status->hashtags;
|
||||
|
||||
return $this->collection($tags, new HashtagTransformer());
|
||||
}
|
||||
|
||||
public function includeMediaAttachments(Status $status)
|
||||
{
|
||||
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(3), function() use($status) {
|
||||
|
|
|
@ -17,6 +17,7 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
{
|
||||
protected $defaultIncludes = [
|
||||
'account',
|
||||
'tags',
|
||||
'media_attachments',
|
||||
];
|
||||
|
||||
|
@ -74,6 +75,13 @@ class StatusTransformer extends Fractal\TransformerAbstract
|
|||
return $this->item($account, new AccountTransformer());
|
||||
}
|
||||
|
||||
public function includeTags(Status $status)
|
||||
{
|
||||
$tags = $status->hashtags;
|
||||
|
||||
return $this->collection($tags, new HashtagTransformer());
|
||||
}
|
||||
|
||||
public function includeMediaAttachments(Status $status)
|
||||
{
|
||||
return Cache::remember('status:transformer:media:attachments:'.$status->id, now()->addMinutes(14), function() use($status) {
|
||||
|
|
Loading…
Reference in a new issue