const execption

This commit is contained in:
Charles 2025-07-17 10:39:32 +02:00
parent 798ca4ba07
commit b54fe41795
1 changed files with 2 additions and 1 deletions

View File

@ -16,6 +16,7 @@ use Symfony\Component\Routing\Attribute\Route;
#[Route(path: '/user', name: 'user_')]
class UserController extends AbstractController
{
private const NOT_FOUND = 'User not found';
public function __construct(
private readonly UserOrganizationService $userOrganizationService,
private readonly EntityManagerInterface $entityManager,
@ -171,7 +172,7 @@ class UserController extends AbstractController
$user->setIsActive(false);
$entityManager->persist($user);
$entityManager->flush();
return $this->redirectToRoute('user_dashboard');
return $this->redirectToRoute('user_index');
}
return new Response('Unauthorized', Response::HTTP_UNAUTHORIZED);
}