diff --git a/userservice/userservice/user-service.js b/userservice/userservice/user-service.js index f157bd4..a991412 100644 --- a/userservice/userservice/user-service.js +++ b/userservice/userservice/user-service.js @@ -48,7 +48,7 @@ app.post('/adduser', async (req, res) => { app.get('/updateStats', async (req,res) => { const { username, numRespuestasCorrectas, numRespuestasIncorrectas} = req.query; try { - query = { username: username.toString() }; + let query = { username: username.toString() }; const user = await User.findOne(query); if (!user) { return res.status(404).json({ success: false, message: 'Usuario no encontrado' }); @@ -66,7 +66,7 @@ app.get('/updateStats', async (req,res) => { app.get('/getUserData', async (req, res) => { const { username } = req.query; - query = { username: username.toString() }; + let query = { username: username.toString() }; try { const user = await User.findOne(query); if (!user) {