feat: filter for feedbacks, code cleanup

This commit is contained in:
Björn Fromme
2024-10-28 16:19:45 +01:00
parent 49faa1eb25
commit a8ccdc8775
11 changed files with 297 additions and 27 deletions
@@ -3,6 +3,7 @@
namespace App\Controller\Administrative\Feedback;
use App\Repository\FeedbackRepository;
use App\Service\Common\FeedbackFilterHandler;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
@@ -13,6 +14,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
class IndexController extends AbstractController
{
public function __construct(
private readonly FeedbackFilterHandler $filterHandler,
private readonly FeedbackRepository $feedbackRepository,
private readonly PaginatorInterface $paginator
) {
@@ -22,9 +24,11 @@ class IndexController extends AbstractController
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Request $request): Response
{
$filterDto = $this->filterHandler->getFilterSettings();
$query = $this
->feedbackRepository
->getListQuery()
->getListQuery($filterDto)
;
$pagination = $this->paginator->paginate(
@@ -39,6 +43,7 @@ class IndexController extends AbstractController
return $this->render('administrative/feedback/index.html.twig', [
'pagination' => $pagination,
'filterDto' => $filterDto,
]);
}
}