feat: filter documents
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Controller\Administrative\Document;
|
||||
|
||||
use App\Repository\UploadRepository;
|
||||
use App\Service\Common\DocumentFilterHandler;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -14,7 +15,8 @@ class IndexController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly UploadRepository $uploadRepository,
|
||||
private readonly PaginatorInterface $paginator
|
||||
private readonly PaginatorInterface $paginator,
|
||||
private readonly DocumentFilterHandler $filterHandler
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -22,9 +24,11 @@ class IndexController extends AbstractController
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
public function index(Request $request): Response
|
||||
{
|
||||
$filterDto = $this->filterHandler->getFilterSettings();
|
||||
|
||||
$query = $this
|
||||
->uploadRepository
|
||||
->getUploadListQuery()
|
||||
->getUploadListQuery($filterDto)
|
||||
;
|
||||
|
||||
$pagination = $this->paginator->paginate(
|
||||
@@ -35,6 +39,7 @@ class IndexController extends AbstractController
|
||||
|
||||
return $this->render('administrative/document/index.html.twig', [
|
||||
'pagination' => $pagination,
|
||||
'filterDto' => $filterDto,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user