Fix call to getIncludesForTransformer

This commit is contained in:
Dane Everitt 2021-08-07 14:54:22 -07:00
parent 9e0ec8fca8
commit 1bc1b87422
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53

View File

@ -34,11 +34,10 @@ class ClientController extends ClientApiController
public function index(GetServersRequest $request): array
{
$user = $request->user();
$transformer = ServerTransformer::class;
// Start the query builder and ensure we eager load any requested relationships from the request.
$builder = QueryBuilder::for(
Server::query()->with($this->getIncludesForTransformer($transformer, ['node']))
Server::query()->with($this->getIncludesForTransformer(new ServerTransformer(), ['node']))
)->allowedFilters([
'uuid',
'name',
@ -69,7 +68,7 @@ class ClientController extends ClientApiController
$servers = $builder->paginate(min($request->query('per_page', 50), 100))->appends($request->query());
return $this->fractal->transformWith($transformer)->collection($servers)->toArray();
return $this->fractal->transformWith(new ServerTransformer())->collection($servers)->toArray();
}
/**