diff --git a/gatewayservice/openapi.yaml b/gatewayservice/openapi.yaml
index a74fcb42..8c1ae9fc 100644
--- a/gatewayservice/openapi.yaml
+++ b/gatewayservice/openapi.yaml
@@ -102,7 +102,7 @@ paths:
get:
summary: Get User Information
parameters:
- - in: query
+ - in: param
name: username
schema:
type: string
diff --git a/webapp/src/components/Profile/Profile.js b/webapp/src/components/Profile/Profile.js
index c4816a6c..5e553a22 100644
--- a/webapp/src/components/Profile/Profile.js
+++ b/webapp/src/components/Profile/Profile.js
@@ -1,20 +1,17 @@
import { Box, VStack, Heading, Text, Center, Spinner, Table, Thead, Tbody, Tr, Th, Td, Avatar } from "@chakra-ui/react";
import React, { useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
-import { useParams } from "react-router-dom";
-const Perfil = () => {
+const Profile = (user) => {
const gatewayUrl = process.env.REACT_APP_API_ENDPOINT || "http://localhost:8000";
const [userData, setUserData] = useState(null);
const [loading, setLoading] = useState(true);
- const params = useParams();
- const user = params.user || localStorage.getItem("username");
const [error, setError] = useState(null);
const { t } = useTranslation();
useEffect(() => {
- fetch(gatewayUrl + `/userInfo/${encodeURIComponent(user)}`)
+ fetch(gatewayUrl + `/userInfo/${user.username}`)
.then((response) => response.json())
.then((data) => {
setUserData(data);
@@ -45,7 +42,7 @@ const Perfil = () => {
<>
{userData && (
<>
-
+
{t('components.profile.name')} {userData.username}
@@ -56,7 +53,7 @@ const Perfil = () => {
{t('components.profile.recentGames')}
-
+
{ userData.games && userData.games.length > 0 ? (
@@ -95,5 +92,5 @@ const Perfil = () => {
);
};
-export default Perfil;
+export default Profile;
diff --git a/webapp/src/pages/Perfil/Perfil.js b/webapp/src/pages/Perfil/Perfil.js
index 3b163a05..d0640e1c 100644
--- a/webapp/src/pages/Perfil/Perfil.js
+++ b/webapp/src/pages/Perfil/Perfil.js
@@ -4,10 +4,12 @@ import Footer from "../../components/Footer/Footer.js";
import Profile from "../../components/Profile/Profile.js";
const Perfil = () => {
+ const username = localStorage.getItem("username");
+
return (
<>
-
+
>
);
diff --git a/webapp/src/pages/Social/FriendsList.js b/webapp/src/pages/Social/FriendsList.js
index 82bcad8e..bef4b94d 100644
--- a/webapp/src/pages/Social/FriendsList.js
+++ b/webapp/src/pages/Social/FriendsList.js
@@ -37,8 +37,6 @@ const FriendList = () => {
return response.json();
})
.then((data) => {
- console.log(data);
- console.log(data.friends);
setFriends(data.friends);
setIsLoading(false);
})