Feat: Implement disposition document handling for admins

This commit is contained in:
Björn Fromme
2023-10-13 17:20:13 +02:00
parent 789249cba7
commit 194cd4e59d
12 changed files with 282 additions and 39 deletions
@@ -1,31 +0,0 @@
<?php
namespace App\Controller\Admin\Document;
use App\Entity\Upload;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class DeleteController extends AbstractController
{
public function __construct(
private readonly EntityManagerInterface $entityManager,
private readonly LoggerInterface $logger
)
{
}
#[Route('/admin/document/delete/{uuid}', name: 'app_admin_document_delete')]
#[IsGranted('ROLE_ADMINISTRATIVE')]
public function index(Upload $document): Response
{
$this->entityManager->remove($document);
$this->entityManager->flush();
return $this->render('');
}
}