Working on adding images
This commit is contained in:
parent
88f41c41f0
commit
63649750d3
2
.env
2
.env
|
@ -1 +1 @@
|
|||
REACT_APP_API_URL=http://10.0.0.16:8080
|
||||
REACT_APP_API_URL=http://10.0.0.66:8080
|
||||
|
|
|
@ -8,6 +8,8 @@ import {
|
|||
Button,
|
||||
IconButton,
|
||||
Typography,
|
||||
Avatar, // Import Avatar for image display
|
||||
ListItemAvatar // Import ListItemAvatar
|
||||
} from '@mui/material';
|
||||
import { Delete as DeleteIcon, Edit as EditIcon } from '@mui/icons-material';
|
||||
import axios from 'axios';
|
||||
|
@ -121,6 +123,14 @@ export default function Items({ token }) {
|
|||
</IconButton>
|
||||
</>
|
||||
}>
|
||||
<ListItemAvatar>
|
||||
<Avatar
|
||||
src= {axios.get(`${process.env.REACT_APP_API_URL}/items/${+item.ID}/image`, {
|
||||
headers: { Authorization: `Bearer ${token}` }})}
|
||||
{Console.log(src)}
|
||||
alt={item.name}
|
||||
/>
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary={item.name}
|
||||
secondary={
|
||||
|
|
Loading…
Reference in New Issue