WIP: Implement application handling
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller\Admin\Application;
|
||||
|
||||
use App\Entity\Application;
|
||||
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/application/delete/{uuid}', name: 'app_admin_application_delete')]
|
||||
#[IsGranted('ROLE_ADMINISTRATIVE')]
|
||||
#[IsGranted('DELETE', subject: 'application')]
|
||||
public function index(Application $application): Response
|
||||
{
|
||||
$this->entityManager->remove($application);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->addFlash('success', 'Die Bewerbung wurde gelöscht');
|
||||
$this->logger->info('Delete application', [
|
||||
'application' => $application->getUuid(),
|
||||
]);
|
||||
|
||||
return $this->redirectToRoute('app_admin_assignment_detail', [
|
||||
'uuid' => $application->getAssignment()->getUuid(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user