feat: rework automatic job profile assignment
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Controller\Admin\Teamer\TrainingAttendance;
|
||||
|
||||
use App\Controller\Traits\ReturnUrlTrait;
|
||||
use App\Entity\TrainingAttendance;
|
||||
use App\Event\TrainingAttendanceDeletedEvent;
|
||||
use App\Htmx\HxRedirectResponse;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -12,6 +13,7 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
||||
|
||||
class DeleteController extends AbstractController
|
||||
{
|
||||
@@ -19,11 +21,15 @@ class DeleteController extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly EventDispatcherInterface $eventDispatcher,
|
||||
private readonly LoggerInterface $logger
|
||||
) {
|
||||
}
|
||||
|
||||
#[Route('/admin/teamer/skills/training-attendance/delete/{uuid}', name: 'app_admin_teamer_skills_training_attendance_delete')]
|
||||
#[Route(
|
||||
path: '/admin/teamer/skills/training-attendance/delete/{uuid}',
|
||||
name: 'app_admin_teamer_skills_training_attendance_delete'
|
||||
)]
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
public function index(TrainingAttendance $attendance, Request $request): Response
|
||||
{
|
||||
@@ -33,6 +39,11 @@ class DeleteController extends AbstractController
|
||||
$this->entityManager->remove($attendance);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->eventDispatcher->dispatch(
|
||||
new TrainingAttendanceDeletedEvent($attendance),
|
||||
TrainingAttendanceDeletedEvent::NAME
|
||||
);
|
||||
|
||||
$this->addFlash('success', 'Die Teilnahme an der Fortbilundg wurde gelöscht');
|
||||
$this->logger->info('Delete training attendance', [
|
||||
'attendance_id' => $attendance->getId(),
|
||||
|
||||
Reference in New Issue
Block a user