Получение списка менеджеров в админке
This commit is contained in:
parent
3bf2eee43d
commit
d0c8569a3c
@ -28,6 +28,9 @@ const Users: React.FC = () => {
|
||||
const [selectedValue, setSelectedValue] = React.useState("admin");
|
||||
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setSelectedValue(event.target.value);
|
||||
|
||||
if (selectedValue === "manager") {
|
||||
}
|
||||
};
|
||||
|
||||
const navigate = useNavigate();
|
||||
@ -63,6 +66,7 @@ const Users: React.FC = () => {
|
||||
|
||||
const [roles, setRoles] = React.useState<TMockData>([]);
|
||||
const [users, setUsers] = React.useState<UsersType>();
|
||||
const [manager, setManager] = React.useState<UsersType>();
|
||||
|
||||
React.useEffect(() => {
|
||||
const axiosRoles = async () => {
|
||||
@ -80,12 +84,19 @@ const Users: React.FC = () => {
|
||||
setUsers(data);
|
||||
};
|
||||
|
||||
const gettingListManagers = async () => {
|
||||
const { data } = await axios({
|
||||
method: "get",
|
||||
url: "https://admin.pena.digital/user/",
|
||||
});
|
||||
setManager(data);
|
||||
};
|
||||
|
||||
gettingListManagers();
|
||||
gettingRegisteredUsers();
|
||||
axiosRoles();
|
||||
}, []);
|
||||
|
||||
console.log(users);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Button
|
||||
@ -448,6 +459,73 @@ const Users: React.FC = () => {
|
||||
<ConditionalRender
|
||||
isLoading={false}
|
||||
role={selectedValue}
|
||||
childrenManager={
|
||||
<>
|
||||
{manager &&
|
||||
manager.map(({ login, email, phoneNumber, isDeleted, createdAt }) => (
|
||||
<TableRow
|
||||
key={createdAt}
|
||||
sx={{
|
||||
borderBottom: "2px solid",
|
||||
borderColor: theme.palette.grayLight.main,
|
||||
height: "100px",
|
||||
}}
|
||||
>
|
||||
<TableCell sx={{ textAlign: "center" }}>
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
color: theme.palette.secondary.main,
|
||||
}}
|
||||
>
|
||||
{login}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
|
||||
<TableCell sx={{ textAlign: "center" }}>
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
color: theme.palette.secondary.main,
|
||||
}}
|
||||
>
|
||||
{email}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell sx={{ textAlign: "center" }}>
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
color: theme.palette.secondary.main,
|
||||
}}
|
||||
>
|
||||
{phoneNumber}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell sx={{ textAlign: "center" }}>
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
color: theme.palette.secondary.main,
|
||||
}}
|
||||
>
|
||||
{isDeleted ? "true" : "false"}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
<TableCell sx={{ textAlign: "center" }}>
|
||||
<Typography
|
||||
variant="h4"
|
||||
sx={{
|
||||
color: theme.palette.secondary.main,
|
||||
}}
|
||||
>
|
||||
{createdAt}
|
||||
</Typography>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</>
|
||||
}
|
||||
childrenUser={
|
||||
<>
|
||||
{users &&
|
||||
|
Loading…
Reference in New Issue
Block a user