diff --git a/front/views/Home.tsx b/front/views/Home.tsx index f757a30..1deedec 100644 --- a/front/views/Home.tsx +++ b/front/views/Home.tsx @@ -18,6 +18,7 @@ export default function Home({ {tactics.map(tactic => (
{tactic.name}
))} + ) } @@ -32,11 +33,12 @@ export function Title() { } -export function Body() { + +export function Body({tactics} : {tactics : Tactic[]}) { return (
- +
) } @@ -50,12 +52,23 @@ export function Team() { ) } -export function Tactic() { +export function Tactic({tactics} : { tactics : Tactic[]}) { + const listTactic = tactics.map(tactic => +
  • + {tactic.name} : {tactic.creationDate} +
  • + ); return (

    Mes stratégies

    + +
    ) diff --git a/src/App/Controller/UserController.php b/src/App/Controller/UserController.php index a5d55df..4657140 100644 --- a/src/App/Controller/UserController.php +++ b/src/App/Controller/UserController.php @@ -24,6 +24,7 @@ class UserController { */ public function home(SessionHandle $session): ViewHttpResponse { $lastTactic = $this->tactics->getLast(5); + var_dump($lastTactic); return ViewHttpResponse::react("views/Home.tsx", [ "tactics" => $lastTactic ]); diff --git a/src/Core/Gateway/TacticInfoGateway.php b/src/Core/Gateway/TacticInfoGateway.php index 67cffc4..1f507cf 100644 --- a/src/Core/Gateway/TacticInfoGateway.php +++ b/src/Core/Gateway/TacticInfoGateway.php @@ -51,7 +51,7 @@ class TacticInfoGateway { [":nb" => [$nb, PDO::PARAM_INT]] ); if (count($res) == 0) { - return null; + return []; } return $res; }