diff --git a/gatewayservice/gateway-service.js b/gatewayservice/gateway-service.js
index 229cd8b..6eaee8f 100644
--- a/gatewayservice/gateway-service.js
+++ b/gatewayservice/gateway-service.js
@@ -130,14 +130,12 @@ app.get('/rankings/:filter', async (req, res) => {
app.get('/ranking/user', async (req, res) => {
const username = req.query.username;
- const category = req.query.category;
try {
// Forward the request to the user service
const result = await axios.get(`${userServiceUrl}/ranking/user`, {
params: {
- username: username,
- category: category
+ username: username
}
});
diff --git a/gatewayservice/gateway-service.test.js b/gatewayservice/gateway-service.test.js
index 9a1ba0c..4ba0838 100644
--- a/gatewayservice/gateway-service.test.js
+++ b/gatewayservice/gateway-service.test.js
@@ -90,7 +90,6 @@ describe('Gateway Service', () => {
} else if (url.endsWith('/ranking/user')) {
return Promise.resolve({data:{
username: data.params.username,
- category: data.params.category,
points: 5,
questions: 7,
correct: 5,
@@ -290,13 +289,11 @@ it('should forward get Foods request to question service', async () => {
.get('/ranking/user')
.query({
username: "username",
- category: "category"
})
// Verify response body
expect(response.body).toEqual({
username: "username",
- category: "category",
points: 5,
questions: 7,
correct: 5,
diff --git a/users/userservice/user-service.js b/users/userservice/user-service.js
index a8989c6..0d63028 100644
--- a/users/userservice/user-service.js
+++ b/users/userservice/user-service.js
@@ -57,7 +57,6 @@ app.get('/rankings/:filter', async (req, res) => {
// Get the ranking info for a specified category and user
app.get('/ranking/user', async (req, res) => {
const username = req.query.username;
- const category = req.query.category;
try {
// Fetch the user with the specified username
@@ -68,17 +67,7 @@ app.get('/ranking/user', async (req, res) => {
return res.status(400).json("Error: User not found");
}
- // Extract ranking info for the specified category
- const rankingInfo = {
- username: user.username,
- category,
- points: user.ranking[category].points,
- questions: user.ranking[category].questions,
- correct: user.ranking[category].correct,
- wrong: user.ranking[category].wrong
- };
-
- res.status(200).json(rankingInfo);
+ res.status(200).json(user);
} catch (error) {
res.status(400).json({ error: error.message });
}
diff --git a/webapp/src/components/ranking/profile_img.webp b/webapp/public/profile_img.webp
similarity index 100%
rename from webapp/src/components/ranking/profile_img.webp
rename to webapp/public/profile_img.webp
diff --git a/webapp/src/App.jsx b/webapp/src/App.jsx
index 93dbea8..922ca25 100644
--- a/webapp/src/App.jsx
+++ b/webapp/src/App.jsx
@@ -1,13 +1,13 @@
import React from 'react';
import {BrowserRouter, Routes, Route} from 'react-router-dom'
-import AddUser from './components/AddUser';
+import AddUser from './components/auth/AddUser';
import Navbar from './components/Navbar';
-import Login from './components/Login';
+import Login from './components/auth/Login';
import RankingsLayout from './components/ranking/RankingLayout';
-import Game from './components/Game';
+import Game from './components/game/Game';
import MainPage from './components/MainPage';
import Squads from './components/Squads';
-import UserProfile from './components/UserProfile';
+import UserProfile from './components/user/UserProfile';
function App() {
diff --git a/webapp/src/components/MainPage.jsx b/webapp/src/components/MainPage.jsx
index 7db41a5..bf95513 100644
--- a/webapp/src/components/MainPage.jsx
+++ b/webapp/src/components/MainPage.jsx
@@ -21,11 +21,11 @@ const MainPage = () => {
, [logged]);
return (
-
+
{logged ?
-
Welcome back, {auth.username}!
+
Welcome back, {auth.username}!
@@ -48,7 +48,7 @@ const MainPage = () => {
:
-
Welcome to WIQ, Please log in to play!
+
Welcome to WIQ, Please log in to play!