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