A
Size: a a a
A
A
M
M
const [notes, setNotes] = React.useState([]);
const [isLoading, setLoading] = React.useState(false);
const id = props.match.params.id;
useEffect(() => {
// GET request using axios inside useEffect React hook
axios
.get(
`https://elepsio.herokuapp.com/admin/users/${id}?offset=0&count=100&query=34&orderBy=asc`
)
.then(result => setNotes(result.data), setLoading(true));
}, []);
A
M
{notes?.map(notes => {
return (
<Card key={notes._id} style={{ marginBottom: "20px" }}>
<CardContent>
<Typography
className={classes.title}
color="textSecondary"
gutterBottom
>
Дата создания: {notes.createDate}
</Typography>
<Typography
className={classes.title}
color="textSecondary"
gutterBottom
>
Обновлено: {notes.updateDate}
</Typography>
<Typography variant="h5" component="h2">
{notes.title}
</Typography>
<Typography
variant="body2"
color="textSecondary"
component="p"
>
{notes.content}
</Typography>
</CardContent>
</Card>
);
})}A
M
M

M
A
M
M
M
A
M
M
M
A