Lazy-load any included relationships on /api/tags

This commit is contained in:
Dave Shoreman 2017-04-11 14:01:17 +01:00
parent f61d834a76
commit c2fe1fdce5

View File

@ -57,7 +57,10 @@ class ListTagsController extends AbstractCollectionController
protected function data(ServerRequestInterface $request, Document $document)
{
$actor = $request->getAttribute('actor');
$include = $this->extractInclude($request);
return $this->tags->whereVisibleTo($actor)->withStateFor($actor)->get();
$tags = $this->tags->whereVisibleTo($actor)->withStateFor($actor)->get();
return $tags->load($include);
}
}