commit
This commit is contained in:
parent
1c1dd559ef
commit
25f5de3975
1 changed files with 3 additions and 3 deletions
|
@ -9,10 +9,10 @@ export default function Helpers({ gameid, user, token }) {
|
|||
|
||||
useEffect(() => {
|
||||
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"));
|
||||
setHelpers(JSON.parse(response.data.helpers));
|
||||
setHelping(JSON.parse(response.data.helpers).includes(user.username));
|
||||
setHelpers(response.data);
|
||||
setHelping(response.data.includes(user.username));
|
||||
setGameLoading(false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue