+
Stuff Design
This commit is contained in:
+7
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user