From e3f309dd738b7029687ec3fc0c0da0e232c19c38 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Wed, 21 Feb 2024 11:03:25 +0100 Subject: [PATCH] refining component --- src/components/game/ExtraControls.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/game/ExtraControls.jsx b/src/components/game/ExtraControls.jsx index 955d346..a5c452d 100644 --- a/src/components/game/ExtraControls.jsx +++ b/src/components/game/ExtraControls.jsx @@ -6,15 +6,18 @@ import { useUser } from "../../hooks/useUser"; import { postGameStatisticsData } from "../../services/WordpressFetchData"; export default function ExtraControls() { const { language, country } = useUser(); - const { contextGameDatas, score, currentGameModal, setCurrentGameModal } = useGame(); + const { contextGameDatas, score, currentGameModal, setCurrentGameModal, buildGameStatsObject } = useGame(); const navigate = useNavigate(); const correctAnswer = contextGameDatas?.gameObjects[0].attrs.behaviourType; const objectPictureUrl = contextGameDatas?.gameObjects[0].attrs.objectPictureUrl; + const datas = buildGameStatsObject(); + function sendDatasTest() { - postGameStatisticsData(); + // console.log(datas); + postGameStatisticsData(datas); } return (