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 be5c28f..84e9440 100644
--- a/src/App/Controller/UserController.php
+++ b/src/App/Controller/UserController.php
@@ -22,6 +22,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 447c7a5..985c58a 100644
--- a/src/Core/Gateway/TacticInfoGateway.php
+++ b/src/Core/Gateway/TacticInfoGateway.php
@@ -49,7 +49,7 @@ class TacticInfoGateway {
[":nb" => [$nb, PDO::PARAM_INT]]
);
if (count($res) == 0) {
- return null;
+ return [];
}
return $res;
}