From ba0f97df25c852699ff86fbc46fde8adc3446f51 Mon Sep 17 00:00:00 2001 From: UO289432 Date: Wed, 10 Apr 2024 19:44:01 +0200 Subject: [PATCH] Especificada variable query --- userservice/userservice/user-service.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) {