Skip to content

Commit

Permalink
Quitando comentarios y variables sin usar
Browse files Browse the repository at this point in the history
  • Loading branch information
larafmz committed Apr 8, 2024
1 parent b9d8224 commit 714eefa
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 63 deletions.
22 changes: 0 additions & 22 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,6 @@ app.get('/updateStats', async (req, res) => {
}
});

// app.get('/updateIncorrectAnswers', async (req, res) => {
// const params = {username: req.query.username, numAnswers: req.query.numAnswers};
// try{
// const updateStatsResponse = await axios.get(userServiceUrl+ `/updateIncorrectAnswers?params=${params}`)
// res.json(updateStatsResponse.data);
// }catch(error){
// res.status(error.response.status).json({error: error.response.data.error});
// }
// });

// app.get('/updateCompletedGames', async (req, res) => {
// const { username } = req.query;
// try{
// const updateStatsResponse = await axios.get(userServiceUrl+ `/updateCompletedGames?username=${username}`)
// res.json(updateStatsResponse.data);
// }catch(error){
// res.status(error.response.status).json({error: error.response.data.error});
// }
// });



app.get('/getUserData', async (req, res) => {
console.log(req.query)
const { username } = req.query;
Expand Down
39 changes: 0 additions & 39 deletions userservice/userservice/user-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,6 @@ app.get('/updateStats', async (req,res) => {
}
})

// app.get('/updateIncorrectAnswers', async (req,res) => {
// console.log(req.query)
// //const { username } = req.query;
// const { username } = req.query.username;
// const { numAnswers } = req.query.numAnswers;
// try {
// const user = await User.findOne({ username });
// if (!user) {
// return res.status(404).json({ success: false, message: 'Usuario no encontrado' });
// }
// // Incrementa las respuestas incorrectas del usuario
// user.incorrectAnswers = numAnswers;
// await user.save();
// return res.status(200).json({ success: true, message: 'Respuestas incorrectas actualizada con éxito' });
// } catch (error) {
// console.error('Error al actualizar la respuesta correcta:', error);
// return res.status(500).json({ success: false, message: 'Error al actualizar las respuestas incorrectas' });
// }
// })

app.get('/getUserData', async (req, res) => {
const { username } = req.query;
try {
Expand All @@ -100,25 +80,6 @@ app.get('/getUserData', async (req, res) => {
}
});


// app.get('/updateCompletedGames', async (req,res) => {
// console.log(req.query)
// const { username } = req.query;
// try {
// const user = await User.findOne({ username });
// if (!user) {
// return res.status(404).json({ success: false, message: 'Usuario no encontrado' });
// }
// user.completedGames += 1;
// await user.save();
// return res.status(200).json({ success: true, message: 'Juegos completados actualizado con éxito' });
// } catch (error) {
// console.error('Error al actualizar Juegos completados:', error);
// return res.status(500).json({ success: false, message: 'Error al actualizar Juegos completados' });
// }
// })


const server = app.listen(port, () => {
console.log(`User Service listening at http://localhost:${port}`);
});
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Pages/Estadisticas.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/components/Login.js
import React, { useState, useEffect } from 'react';
import { Container, Typography, TextField, Button, Snackbar } from '@mui/material';
import { Container } from '@mui/material';
import '../Estilos/estadisticas.css';
import axios from 'axios';

Expand Down
1 change: 0 additions & 1 deletion webapp/src/components/Pages/Juego.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import axios from 'axios';
import '../Estilos/juego.css';
import { Container } from '@mui/material';
import Temporizador from '../Temporizador';
import { jwtDecode } from 'jwt-decode';

const Juego = ({isLogged, username, numPreguntas}) => {
//La pregunta (string)
Expand Down

0 comments on commit 714eefa

Please sign in to comment.