Stuff Design
This commit is contained in:
Marces Zastrow
2025-01-09 10:51:54 +01:00
parent a638c96a63
commit da5071fa34
5 changed files with 124 additions and 34 deletions
Binary file not shown.
+7 -4
View File
@@ -238,16 +238,19 @@ app.put('/games/:gameId/:userId/character', (req, res) => {
});
// Fetch Player Items
app.get('/games/:charId/items', (req, res) => {
app.get('/games/:gameId/:charId/items', (req, res) => {
const gameId = req.params.gameId;
const charId = req.params.charId;
db.get('SELECT * FROM Item WHERE GameID = ? AND OwnerID = ?', [gameId, charId], (err, row) => {
console.log(`Fetching Items for GameID: ${gameId}, CharID: ${charId}`);
db.all('SELECT * FROM Item WHERE GameID = ? AND OwnerID = ?', [gameId, charId], (err, rows) => {
if (err) {
console.error('Database error:', err); // Debug output
return res.status(500).json({ error: 'Internal server error' });
}
res.json(row);
console.log(rows); // Debug output
res.json(rows);
});
})
});
// Item Part
// Set Item Owner