Working on adding images

This commit is contained in:
Steve White 2024-10-10 10:23:19 -05:00
parent 88f41c41f0
commit 63649750d3
2 changed files with 11 additions and 1 deletions

2
.env
View File

@ -1 +1 @@
REACT_APP_API_URL=http://10.0.0.16:8080 REACT_APP_API_URL=http://10.0.0.66:8080

View File

@ -8,6 +8,8 @@ import {
Button, Button,
IconButton, IconButton,
Typography, Typography,
Avatar, // Import Avatar for image display
ListItemAvatar // Import ListItemAvatar
} from '@mui/material'; } from '@mui/material';
import { Delete as DeleteIcon, Edit as EditIcon } from '@mui/icons-material'; import { Delete as DeleteIcon, Edit as EditIcon } from '@mui/icons-material';
import axios from 'axios'; import axios from 'axios';
@ -121,6 +123,14 @@ export default function Items({ token }) {
</IconButton> </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 <ListItemText
primary={item.name} primary={item.name}
secondary={ secondary={