From c2fe1fdce54541461501ce13004b5c2cb498ff74 Mon Sep 17 00:00:00 2001 From: Dave Shoreman Date: Tue, 11 Apr 2017 14:01:17 +0100 Subject: [PATCH] Lazy-load any included relationships on /api/tags --- extensions/tags/src/Api/Controller/ListTagsController.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/tags/src/Api/Controller/ListTagsController.php b/extensions/tags/src/Api/Controller/ListTagsController.php index 0d2038805..786d2ed7c 100644 --- a/extensions/tags/src/Api/Controller/ListTagsController.php +++ b/extensions/tags/src/Api/Controller/ListTagsController.php @@ -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); } }