This commit is contained in:
Lukian LEIZOUR 2024-06-06 13:37:00 +02:00
parent 1c1dd559ef
commit 25f5de3975

View file

@ -9,10 +9,10 @@ export default function Helpers({ gameid, user, token }) {
useEffect(() => { useEffect(() => {
async function fetchGame() { async function fetchGame() {
const response = await axios.post("https://leizour.fr/api/v1/games/getGame", { token, gameid }) const response = await axios.post("https://leizour.fr/api/v1/games/getHelpers", { token, gameid })
.catch((error) => console.error("Error getting game")); .catch((error) => console.error("Error getting game"));
setHelpers(JSON.parse(response.data.helpers)); setHelpers(response.data);
setHelping(JSON.parse(response.data.helpers).includes(user.username)); setHelping(response.data.includes(user.username));
setGameLoading(false); setGameLoading(false);
} }