Fix SQl queries being executed unnecessarily when listing servers

This commit is contained in:
Dane Everitt 2018-03-03 18:00:23 -06:00
parent eaf54a8c63
commit a31334c0c5
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 4 additions and 3 deletions

View file

@ -216,7 +216,7 @@ class ServerRepository extends EloquentRepository implements ServerRepositoryInt
*/
public function filterUserAccessServers(User $user, int $level, bool $paginate = true)
{
$instance = $this->getBuilder()->select($this->getColumns())->with(['user']);
$instance = $this->getBuilder()->select($this->getColumns())->with(['user', 'node', 'allocation']);
// If access level is set to owner, only display servers
// that the user owns.