feat: implement real profile save functionality
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m49s

This commit is contained in:
Cauê Faleiros
2026-02-26 10:42:01 -03:00
parent 6fb86b4806
commit 76b919d857
5 changed files with 3359 additions and 8 deletions

View File

@@ -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)