This commit is contained in:
Marces Zastrow
2025-01-17 13:54:01 +01:00
parent 0e888ca258
commit 6f52b6ffb0
3 changed files with 38 additions and 17 deletions
Binary file not shown.
+3 -2
View File
@@ -231,9 +231,10 @@ app.get('/games/:gameId/items', (req, res) => {
if (err) {
return res.status(500).json({ error: 'Internal server error' });
}
// Convert image data to base64 and store as Img property
const processedRows = rows.map(row => {
if (row.img) {
row.Img = `data:image/jpeg;base64,${row.img.toString('base64')}`;
if (row.img) { // Database column is lowercase
row.Img = `data:image/jpeg;base64,${row.img.toString('base64')}`; // Store as uppercase Img
}
return row;
});