feat: filter availabilities
addresses #869at5k4f
This commit is contained in:
1 parent
6795a668da
commit
4ae23bf8a1
8 files changed
+344
-6
No files matched your search
@@ -3,6 +3,7 @@
|
||||
namespace App\Controller\Administrative\Availability;
|
||||
|
||||
use App\Repository\AvailabilityRepository;
|
||||
use App\Service\Common\AvailabilityFilterHandler;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -15,6 +16,7 @@ class IndexController extends AbstractController
|
||||
public function __construct(
|
||||
private readonly AvailabilityRepository $availabilityRepository,
|
||||
private readonly PaginatorInterface $paginator,
|
||||
private readonly AvailabilityFilterHandler $filterHandler,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -22,9 +24,11 @@ class IndexController extends AbstractController
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$filterDto = $this->filterHandler->getFilterSettings();
|
||||
|
||||
$query = $this
|
||||
->availabilityRepository
|
||||
->getListQuery(true)
|
||||
->getListQuery(true, $filterDto)
|
||||
;
|
||||
|
||||
$pagination = $this->paginator->paginate(
|
||||
@@ -39,6 +43,7 @@ class IndexController extends AbstractController
|
||||
|
||||
return $this->render('administrative/availability/index.html.twig', [
|
||||
'pagination' => $pagination,
|
||||
'filterDto' => $filterDto,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user