Skip to content

Commit

Permalink
fix(admin): nav error
Browse files Browse the repository at this point in the history
  • Loading branch information
nullchilly committed Jan 7, 2024
1 parent 9a90129 commit 00d4e17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api/app/endpoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
router.include_router(create_bot_game.auth_router, prefix="/api")
router.include_router(create_human_game.auth_router, prefix="/api")
router.include_router(puzzle.puzzle_router, prefix="/api")
router.include_router(admin.admin_router, prefix="/admin")
router.include_router(admin.admin_router, prefix="/api/admin")
8 changes: 4 additions & 4 deletions src/components/Admin/AdminPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ const AdminPage = () => {
setIsLoading(true);
setShowModalDeleteUser(false);
try {
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/admin/profile`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/admin/profile`;
const savedToken = localStorage.getItem("accessToken");
const raw = JSON.stringify({
"userId": currentUser?.userId
Expand Down Expand Up @@ -242,7 +242,7 @@ const AdminPage = () => {
setIsLoading(true);
setShowModalDeleteGame(false);
try {
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/admin/game`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/admin/game`;
const savedToken = localStorage.getItem("accessToken");
const raw = JSON.stringify({
"gameId": currentGame?.gameId
Expand Down Expand Up @@ -289,7 +289,7 @@ const AdminPage = () => {
const fetchDataUser = async () => {
setIsLoading(true);
try {
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/admin/users`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/admin/users`;
const savedToken = localStorage.getItem("accessToken");
const response = await fetch(url, {
method: "GET",
Expand All @@ -310,7 +310,7 @@ const AdminPage = () => {
const fetchDataGame = async () => {
setIsLoading(true);
try {
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/admin/game`;
const url = `${process.env.NEXT_PUBLIC_BACKEND_URL}/api/admin/game`;
const savedToken = localStorage.getItem("accessToken");
const response = await fetch(url, {
method: "GET",
Expand Down
16 changes: 8 additions & 8 deletions src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,29 +120,29 @@ const Navbar: React.FC = () => {
className="bg-transparent text-white font-['Albula'] text-lg"
>
<SubMenu title={"Play"} icon={<ChessBoard />}>
<Menu.Item key="register" icon={<Human />}>
<Link href="/human"> Play vs Human </Link>
<Menu.Item key="/human" icon={<Human />}>
<Link href="/"> Play vs Human </Link>
</Menu.Item>
<Menu.Item key="register" icon={<ChessBot />}>
<Link href="/computer"> Play vs Bot </Link>
<Menu.Item key="/computer" icon={<ChessBot />}>
<Link href="/"> Play vs Bot </Link>
</Menu.Item>
</SubMenu>
<SubMenu title={"Puzzle"} icon={<Puzzle />}>
<Menu.Item key="register" icon={<Puzzle />}>
<Menu.Item key="/puzzle" icon={<Puzzle />}>
<Link href="/puzzle"> Play Puzzle </Link>
</Menu.Item>
<Menu.Item key="register" icon={<Duel />}>
<Menu.Item key="/puzzle-duel" icon={<Duel />}>
<Link href="/puzzle-duel"> Puzzle Duel </Link>
</Menu.Item>
</SubMenu>
<SubMenu title={"Learn"} icon={<Learn />}>
<Menu.Item key="register" icon={<Video />}>
<Menu.Item key="/videos" icon={<Video />}>
<Link href="/videos"> Videos </Link>
</Menu.Item>
</SubMenu>
{
isAdmin &&
<Menu.Item key="admin" icon={<Admin/>}>
<Menu.Item key="/admin" icon={<Admin/>}>
<Link href="/admin"> Admin </Link>
</Menu.Item>
}
Expand Down

0 comments on commit 00d4e17

Please sign in to comment.