From 359ac637a153e3eecdfb710b3dc413ae466796c7 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 26 Nov 2024 15:12:49 +0100 Subject: [PATCH] Clean ups --- src/Controller/PackageController.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/Controller/PackageController.php b/src/Controller/PackageController.php index 7ebb7fde5..fc7f6fe69 100644 --- a/src/Controller/PackageController.php +++ b/src/Controller/PackageController.php @@ -102,24 +102,13 @@ public function allAction(): RedirectResponse public function listAction(Request $req, PackageRepository $repo, #[MapQueryParameter] ?string $type=null, - #[MapQueryParameter] ?string $vendor=null + #[MapQueryParameter] ?string $vendor=null, ): JsonResponse { $queryParams = $req->query->all(); $fields = (array) ($queryParams['fields'] ?? []); // support single or multiple fields $fields = array_intersect($fields, ['repository', 'type', 'abandoned']); - $qb = $repo->createQueryBuilder('p'); - if ($type) { - $qb->andWhere('p.type = :type')->setParameter('type', $type); - } - if ($vendor) { - $qb->andWhere('p.vendor = :vendor')->setParameter('vendor', $vendor); - } - - $query = $qb->getQuery(); -// dd($fields, $query->getResult()); - if (count($fields) > 0) { $filters = array_filter([ 'type' => $type,