feat: filter for feedbacks, code cleanup
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user