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(() => {
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue