perf: prevent N+1 on watchlist fetch

This commit is contained in:
vinceh121
2025-11-02 03:12:46 +01:00
parent a1aec6b463
commit 0739ef5ca9
4 changed files with 45 additions and 19 deletions

View File

@@ -11,7 +11,6 @@ use App\Repository\DomainRepository;
use App\Repository\WatchlistRepository;
use App\Service\CalendarService;
use App\Service\RDAPService;
use Doctrine\Common\Collections\Collection;
use Eluceo\iCal\Domain\Entity\Calendar;
use Eluceo\iCal\Presentation\Component\Property;
use Eluceo\iCal\Presentation\Component\Property\Value\TextValue;
@@ -36,23 +35,6 @@ class WatchlistController extends AbstractController
) {
}
#[Route(
path: '/api/watchlists',
name: 'watchlist_get_all_mine',
defaults: [
'_api_resource_class' => Watchlist::class,
'_api_operation_name' => 'get_all_mine',
],
methods: ['GET']
)]
public function getWatchlists(): Collection
{
/** @var User $user */
$user = $this->getUser();
return $user->getWatchlists();
}
/**
* @throws ParseException
* @throws EofException