diff --git a/front/views/Home.tsx b/front/views/Home.tsx index 44803a3..8be885d 100644 --- a/front/views/Home.tsx +++ b/front/views/Home.tsx @@ -162,7 +162,7 @@ function TableData({ allTactics }: { allTactics: Tactic[] }) { function BodyPersonalSpace({ allTactics }: { allTactics: Tactic[] }) { let data if (allTactics.length == 0) { - data =

Aucune tactique créé !

+ data =

Aucune tactique créée !

} else { data = } diff --git a/src/App/Controller/UserController.php b/src/App/Controller/UserController.php index 5a034b7..2718843 100644 --- a/src/App/Controller/UserController.php +++ b/src/App/Controller/UserController.php @@ -29,12 +29,15 @@ class UserController { */ public function home(SessionHandle $session): ViewHttpResponse { $limitNbTactics = 5; - $lastTactics = $this->tactics->getLast($limitNbTactics, $session->getAccount()->getUser()->getId()); - $allTactics = $this->tactics->getAll($session->getAccount()->getUser()->getId()); - $name = $session->getAccount()->getUser()->getName(); + + $user = $session->getAccount()->getUser(); + + $lastTactics = $this->tactics->getLast($limitNbTactics, $user->getId()); + $allTactics = $this->tactics->getAll($user->getId()); + $name = $user->getName(); if ($this->teams != null) { - $teams = $this->teams->getAll($session->getAccount()->getUser()->getId()); + $teams = $this->teams->getAll($user->getId()); } else { $teams = []; } @@ -46,11 +49,7 @@ class UserController { "username" => $name, ]); } - - public function homeTwig(SessionHandle $session): ViewHttpResponse { - return ViewHttpResponse::twig("home.twig", []); - } - + /** * @return ViewHttpResponse account settings page */ diff --git a/src/App/Views/home.twig b/src/App/Views/home.twig index 7d8430e..0fc426a 100644 --- a/src/App/Views/home.twig +++ b/src/App/Views/home.twig @@ -74,7 +74,7 @@ {% endfor %} {% else %} -

Aucune équipe créé !

+

Aucune équipe créée !

{% endif %}

Mes strategies

@@ -90,7 +90,7 @@ {% endfor %} {% else %} -

Aucune tactique créé !

+

Aucune tactique créée !

{% endif %}