Skip to content

Commit

Permalink
unnecessary logs removed and sonarcloud fix
Browse files Browse the repository at this point in the history
  • Loading branch information
angelmaciasr committed Apr 29, 2024
1 parent bbb02dd commit 12a73a1
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion gatewayservice/gateway-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ describe('Gateway Service', () => {
it('should retrieve the specified user', async () => {
const response = await request(app).post('/getUser').send({username: "tomas"});
expect(response.status).toBe(200);
console.log(response.body);
checkCorrectUserFields(response.body);

}, 6000);
Expand Down
1 change: 0 additions & 1 deletion users/userservice/user-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ router.get('/getUser', async (req, res) => {
console.error('Error finding user:', err);
} else {
res.status(200).json(result);
console.log('User:', result);
}
});

Expand Down
1 change: 0 additions & 1 deletion webapp/src/components/Game/Answer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const Answer = (props: props) => {
const [clickedAnswer, setClickedAnswer] = useState('');

const handleClick = () => {
console.log('clicked answer');
setClickedAnswer(props.answer);
props.setAnswered(true);
props.setCorrectSelected(props.correctAnswer);
Expand Down
3 changes: 2 additions & 1 deletion webapp/src/components/Game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ export default function Game(props: Props) {

const saveAnswer = (answer: string) => {
answerSelected.push(answer);
setAnswerSelected(answerSelected);
const newAnswerSelected = [...answerSelected];
setAnswerSelected(newAnswerSelected);
}

useEffect(() => {
Expand Down
2 changes: 0 additions & 2 deletions webapp/src/services/auth-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const login = async (username: string, password: string)=> {
const response = await axios.post(`${API_URL}/login`, { username, password });
//const response = await axios.post("http://localhost:8002/auth/login", { username, password });
const token = response.data.token;
console.log('token:', token);
localStorage.setItem('token', token); // store the token in local storage
loginWithToken();
return true;
Expand All @@ -37,7 +36,6 @@ export const login = async (username: string, password: string)=> {
export const register = async (email:string, username: string, password: string) => {
try {
const response = await axios.post(`${API_URL}/adduser`, { username, password, email });
console.log('response:', response);
const name = response.data;
return {error:false,message:name};
} catch (error: any) {
Expand Down
2 changes: 0 additions & 2 deletions wikidataservice/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ init().then(([jsonCountryQuestions, jsonElementsQuestions, jsonMovieQuestions,
questions.push(generateQuestions(jsonChemistryQuestion[i].questionText, jsonChemistryQuestion[i].jsonResult.results.bindings, 1)[0]);
}

console.log(questions)
// Shuffle the questions
let shuffled = questions
.map(value => ({ value, sort: Math.random() }))
Expand All @@ -95,7 +94,6 @@ init().then(([jsonCountryQuestions, jsonElementsQuestions, jsonMovieQuestions,
const randomIndex = Math.floor(Math.random() * jsonHistoryQuestions.length);
let itemData = jsonHistoryQuestions[randomIndex];
const questions = generateQuestions(itemData.questionText, itemData.jsonResult.results.bindings, 1);
console.log(questions)
res.status(200).json(questions);
} catch (error) {
next(error);
Expand Down
1 change: 0 additions & 1 deletion wikidataservice/test/question-service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ describe('Wikidata Service - Question Retrieval', () => {
}

expect(response.status).toBe(200);
console.log(response._body);
expect(response._body.length).toBe(retrieved);
expect(response._body[0]).toHaveProperty("text");
expect(response._body[0]).toHaveProperty("correctAnswer");
Expand Down

0 comments on commit 12a73a1

Please sign in to comment.