Merge branch 'frontend' into gruppDM
This commit is contained in:
commit
7ed9398bcb
13 changed files with 149 additions and 38 deletions
|
|
@ -2,15 +2,13 @@ import BasicWindow from "../../Components/BasicWindow";
|
|||
import Button from "../../Components/Button";
|
||||
import BackButton from "../../Components/BackButton";
|
||||
import { UserListAdmin } from "../../Components/UserListAdmin";
|
||||
import { PublicUser } from "../../Types/goTypes";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import GetAllUsers from "../../Components/GetAllUsers";
|
||||
import { useState } from "react";
|
||||
|
||||
function AdminManageUsers(): JSX.Element {
|
||||
//TODO: Change so that it reads users from database
|
||||
const users: PublicUser[] = [];
|
||||
for (let i = 1; i <= 20; i++) {
|
||||
users.push({ userId: "id" + i, username: "Example User " + i });
|
||||
}
|
||||
const [users, setUsers] = useState<string[]>([]);
|
||||
GetAllUsers({ setUsersProp: setUsers });
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ function App(): JSX.Element {
|
|||
if (authority === 1) {
|
||||
navigate("/admin");
|
||||
} else if (authority === 2) {
|
||||
navigate("/pm");
|
||||
} else if (authority === 3) {
|
||||
navigate("/yourProjects");
|
||||
}
|
||||
}, [authority, navigate]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue