diff --git a/src/App/Controller/UserController.php b/src/App/Controller/UserController.php index e33ee61..5a034b7 100644 --- a/src/App/Controller/UserController.php +++ b/src/App/Controller/UserController.php @@ -16,6 +16,7 @@ class UserController { /** * @param TacticModel $tactics + * @param TeamModel|null $teams */ public function __construct(TacticModel $tactics, ?TeamModel $teams = null) { $this->tactics = $tactics; @@ -28,12 +29,12 @@ class UserController { */ public function home(SessionHandle $session): ViewHttpResponse { $limitNbTactics = 5; - $lastTactics = $this->tactics->getLast($limitNbTactics, $session->getAccount()->getId()); - $allTactics = $this->tactics->getAll($session->getAccount()->getId()); - $name = $session->getAccount()->getName(); + $lastTactics = $this->tactics->getLast($limitNbTactics, $session->getAccount()->getUser()->getId()); + $allTactics = $this->tactics->getAll($session->getAccount()->getUser()->getId()); + $name = $session->getAccount()->getUser()->getName(); if ($this->teams != null) { - $teams = $this->teams->getAll($session->getAccount()->getId()); + $teams = $this->teams->getAll($session->getAccount()->getUser()->getId()); } else { $teams = []; }