Changed some stuff
This commit is contained in:
Marces Zastrow
2025-01-09 08:40:55 +01:00
parent 01465e844b
commit a638c96a63
6 changed files with 113 additions and 9 deletions
Binary file not shown.
+17
View File
@@ -220,6 +220,23 @@ app.get('/games/:gameId/:userId/character', (req, res) => {
});
});
// Update Player Character Description
app.put('/games/:gameId/:userId/character', (req, res) => {
const gameId = req.params.gameId;
const userId = req.params.userId;
const { description } = req.body;
const stmt = db.prepare('UPDATE PlayerCharacter SET description = ? WHERE GameID = ? AND PlayerID = ?');
stmt.run([description, gameId, userId], function (err) {
if (err) {
console.error('Database error:', err); // Debug output
return res.status(500).json({ error: 'Internal server error' });
}
res.json({ message: 'Description updated successfully!' });
});
stmt.finalize();
});
// Fetch Player Items
app.get('/games/:charId/items', (req, res) => {
const gameId = req.params.gameId;