feat: implement real profile save functionality
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s
This commit is contained in:
@@ -48,6 +48,22 @@ app.get('/api/users/:id', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Atualizar Usuário
|
||||
app.put('/api/users/:id', async (req, res) => {
|
||||
const { name, bio } = req.body;
|
||||
try {
|
||||
await pool.query(
|
||||
'UPDATE users SET name = ?, bio = ? WHERE id = ?',
|
||||
[name, bio, req.params.id]
|
||||
);
|
||||
res.json({ message: 'User updated successfully' });
|
||||
} catch (error) {
|
||||
console.error('Erro ao atualizar usuário:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// --- Rotas de Atendimentos ---
|
||||
|
||||
// Listar Atendimentos (Dashboard)
|
||||
|
||||
Reference in New Issue
Block a user