Merge branch 'Johan'

This commit is contained in:
Olivier PARPAILLON
2024-11-20 14:49:55 +01:00
6 changed files with 71 additions and 49 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Controller;
use App\Repository\SortieRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -10,12 +11,14 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
class MainController extends AbstractController
{
#[Route('/', name: 'home')]
public function index(TokenStorageInterface $tokenStorage): Response
public function index(TokenStorageInterface $tokenStorage, SortieRepository $sortieRepository): Response
{
$token = $tokenStorage->getToken();
$userConnect = $token?->getUser();
$sorties = $sortieRepository->findAll();
return $this->render('main/index.html.twig', [
'profile' => $userConnect,
'sorties' => $sorties,
]);
}