Merge pull request #880 from pixelfed/frontend-ui-refactor

Update StatusTransformer
This commit is contained in:
daniel 2019-02-24 23:41:50 -07:00 committed by GitHub
commit 3627f90807
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,9 +62,10 @@ class StatusTransformer extends Fractal\TransformerAbstract
public function includeMediaAttachments(Status $status)
{
$media = $status->media()->orderBy('order')->get();
return $this->collection($media, new MediaTransformer());
return Cache::remember('status:transformer:media:attachments:'.$status->id, 1440, function() use($status) {
$media = $status->media()->orderBy('order')->get();
return $this->collection($media, new MediaTransformer());
});
}
public function includeTags(Status $status)