+
Changed some stuff
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user