fix UserList :3

This commit is contained in:
cue
2024-04-03 06:16:25 +03:00
parent 18161c9227
commit 5214e03bfc
2 changed files with 10 additions and 12 deletions
@@ -1,6 +1,5 @@
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { Button } from "../../shared/ui/button"; import { Card, CardHeader, CardTitle, CardContent } from "../../shared/ui/card"
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "../../shared/ui/card"
import less from "./PlayerCard.module.less"; import less from "./PlayerCard.module.less";
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../shared/ui/dialog"; import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "../../shared/ui/dialog";
import { Separator } from "../../shared/ui/separator"; import { Separator } from "../../shared/ui/separator";
+9 -10
View File
@@ -1,11 +1,9 @@
import { Button } from "../../shared/ui/button";
import { import {
ResizableHandle, ResizableHandle,
ResizablePanel, ResizablePanel,
ResizablePanelGroup, ResizablePanelGroup,
} from "../../shared/ui/resizable"; } from "../../shared/ui/resizable";
import less from "./Admin.module.less"; import less from "./Admin.module.less";
import PlayerCard from "../../entities/PlayerCard/PlayerCard";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import CreateTeam from "../../widgets/CreateTeams/CreateTeams"; import CreateTeam from "../../widgets/CreateTeams/CreateTeams";
import { UserList } from "../AdminEventPage/AdminEventAPI"; import { UserList } from "../AdminEventPage/AdminEventAPI";
@@ -26,14 +24,15 @@ const AdminPage = () => {
var index = window.location.pathname.indexOf("/dash/admin/") + "/dash/admin/".length; var index = window.location.pathname.indexOf("/dash/admin/") + "/dash/admin/".length;
var result = window.location.pathname.substring(index); var result = window.location.pathname.substring(index);
if(Number(result) > 0){
UserList(result) UserList(result)
.then((data) => { .then((data) => {
setPlayerList(data); setPlayerList(data);
}) })
.catch((error) => { .catch((error) => {
console.error("Возникла ошибка с получением:", error); console.error("Возникла ошибка с получением:", error);
}); });
}
}, []); }, []);
return ( return (
<ResizablePanelGroup className={less["full-content"]} direction="horizontal"> <ResizablePanelGroup className={less["full-content"]} direction="horizontal">