Skip to content

Commit

Permalink
Avoid unnecessary selection of organisation users
Browse files Browse the repository at this point in the history
This was selecting the single user in question and hydrating the organisations' `OrganizationUser` collection with just a single user. Avoiding this select will properly hydrate each organisation.
  • Loading branch information
NFarrington authored Dec 21, 2023
1 parent 66ea150 commit a505212
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Repositories/OrganizationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function findByUser(
int $page = null
) {
$query = $this->createQueryBuilder('o')
->select('o, ou')
->select('o')
->join('o.organizationUsers', 'ou', 'WITH', "ou.user = {$user->getId()}")
->orderBy("o.$orderBy", $order)
->getQuery();
Expand Down

0 comments on commit a505212

Please sign in to comment.