diff --git a/src/client/src/AdminsOverview.js b/src/client/src/AdminsOverview.js index cae1079..7016149 100644 --- a/src/client/src/AdminsOverview.js +++ b/src/client/src/AdminsOverview.js @@ -45,14 +45,16 @@ function AdminCreator(props){ return (
- - {/* */} - +
+ + {/* */} + +
) @@ -72,6 +74,27 @@ function UserList(props){ .catch(error => showError(error)); } + let updateRank = (email) => 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`, { + method: "POST", + body: body + }) + .then(res => res.json()) + .then(data => { + if(data.status !== "OK"){ + showError(data.data); + return; + } + props.onUserUpdated(); + }) + .catch(error => showError(error)); + } + return(
@@ -95,7 +118,12 @@ function UserList(props){ {user.email} {/* TODO Drop down menu for selecting rank */} - {'user.rank'} + + + {/* {team.members} */} {/* */} @@ -112,7 +140,6 @@ function UserList(props){ export default function Users(props) { const [users, setUsers] = React.useState([]); - const { userId } = useParams(); function getUsers() { fetch(process.env.REACT_APP_API_URL + `/users/getUsers`) @@ -144,7 +171,7 @@ export default function Users(props) { <>
- +
diff --git a/src/client/src/components/AsuraBar.js b/src/client/src/components/AsuraBar.js index f27ce89..0bfeef5 100644 --- a/src/client/src/components/AsuraBar.js +++ b/src/client/src/components/AsuraBar.js @@ -57,8 +57,6 @@ function NotLoggedInButton() { } export default function Appbar(props) { - console.log("Appbar-user:") - console.log(props.user); return ( <>