From 2a8dfd0cbf43eade6c95928e5bc04b95dfc1d1e2 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sun, 24 Apr 2022 13:57:30 +0200 Subject: [PATCH] minor update, api endpoint moved --- src/client/src/AdminsOverview.js | 11 +++++------ src/client/src/TournamentOverview.js | 12 ++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/client/src/AdminsOverview.js b/src/client/src/AdminsOverview.js index 7016149..132da10 100644 --- a/src/client/src/AdminsOverview.js +++ b/src/client/src/AdminsOverview.js @@ -61,7 +61,7 @@ function AdminCreator(props){ } function UserList(props){ - const deleteUsers = userId => { + const deleteUsers = (userId) => { fetch(process.env.REACT_APP_API_URL + `/users/${userId}`, {method: "DELETE"}) .then(res => res.json()) .then(data => { @@ -74,13 +74,12 @@ function UserList(props){ .catch(error => showError(error)); } - let updateRank = (email) => event => { + let updateRank = (asuraId) => event => { let isManager = event.target.value == "manager"; let formData = new FormData(); formData.append("isManager", isManager); - formData.append("emailAddress", email); let body = new URLSearchParams(formData); - fetch(process.env.REACT_APP_API_URL + `/users/changeManagerStatus`, { + fetch(process.env.REACT_APP_API_URL + `/users/${asuraId}/changeManagerStatus`, { method: "POST", body: body }) @@ -119,7 +118,7 @@ function UserList(props){ {user.email} {/* TODO Drop down menu for selecting rank */} - @@ -127,7 +126,7 @@ function UserList(props){ {/* {team.members} */} {/* */} - + ))} diff --git a/src/client/src/TournamentOverview.js b/src/client/src/TournamentOverview.js index f9e696d..1a96d23 100644 --- a/src/client/src/TournamentOverview.js +++ b/src/client/src/TournamentOverview.js @@ -89,15 +89,15 @@ function Match(props){ {team1Name} + { props.match.winnerId && (props.match.team1Id === props.match.winnerId) && + + } { props.match.team1Id !== null && !props.tournament.hasEnded && props.match.tier !== Math.log2(props.tournament.teamLimit) - 1 && props.match.winnerId === null && props.user.isLoggedIn && } { props.match.team1Id !== null && props.match.winnerId === null && !props.tournament.hasEnded && props.user.isLoggedIn && } - {/* { props.match.winnerId && (props.match.team1Id === props.match.winnerId) && - - } */}
  •  
  • @@ -107,15 +107,15 @@ function Match(props){ {team2Name} + { props.match.winnerId && (props.match.team2Id === props.match.winnerId) && + + } { props.match.team2Id !== null && !props.tournament.hasEnded && props.match.tier !== Math.log2(props.tournament.teamLimit) - 1 && props.match.winnerId === null && props.user.isLoggedIn && } { props.match.team2Id !== null && props.match.winnerId === null && !props.tournament.hasEnded && props.user.isLoggedIn && } - {/* { props.match.winnerId && (props.match.team2Id === props.match.winnerId) && - - } */}
  •