diff --git a/frontend/src/components/PortfolioDetails.jsx b/frontend/src/components/PortfolioDetails.jsx
index 628660f..e736cab 100644
--- a/frontend/src/components/PortfolioDetails.jsx
+++ b/frontend/src/components/PortfolioDetails.jsx
@@ -12,12 +12,11 @@ import { useUserStore } from "../store/userStore";
import { getPortfolioDetails, getTokenDetails } from "../api/profile.api";
-const PortfolioDetails = () => {
+const PortfolioDetails = ({searchId}) => {
const [suppliedDetails, setSuppliedDetails] = useState([]);
const [borrowedDetails, setBorrowedDetails] = useState([]);
let userAddress = useUserStore((state) => state.userAddress);
userAddress = "0xb63e8a8d04999500a97470769d10c4395789836d";
-
const convertSuppliedToDesiredFormat = async (array) => {
try {
const result = await Promise.all(
@@ -73,7 +72,7 @@ const PortfolioDetails = () => {
};
const callApis = async () => {
- const details = await getPortfolioDetails(userAddress);
+ const details = await getPortfolioDetails(searchId);
const { metadata } = details[0];
const { supplied, borrowed } = metadata;
const derivedSupplied = await convertSuppliedToDesiredFormat(supplied);
@@ -83,7 +82,7 @@ const PortfolioDetails = () => {
};
useEffect(() => {
callApis();
- }, []);
+ }, [searchId]);
// console.log(suppliedDetails);
return (
diff --git a/frontend/src/pages/ProfilePage.jsx b/frontend/src/pages/ProfilePage.jsx
index 32add6b..8138bf3 100644
--- a/frontend/src/pages/ProfilePage.jsx
+++ b/frontend/src/pages/ProfilePage.jsx
@@ -18,6 +18,7 @@ const ProfilePage = () => {
const handleTabChange = (event, newValue) => {
setCurrentTab(newValue);
};
+ const searchId=window.location.pathname.split('/')[2];
return (
<>
@@ -78,7 +79,7 @@ const ProfilePage = () => {
{currentTab === 0 && (
)}
diff --git a/frontend/yarn.lock b/frontend/yarn.lock
index 0d4f80d..0573051 100644
--- a/frontend/yarn.lock
+++ b/frontend/yarn.lock
@@ -6184,11 +6184,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
-fsevents@^2.3.2, fsevents@~2.3.2:
- version "2.3.3"
- resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
- integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
-
function-bind@^1.1.1, function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"