From d4af097cfa74202a843f5777e0bb1d75d84cc51a Mon Sep 17 00:00:00 2001 From: Jihwan Lee Date: Mon, 28 Jul 2025 14:28:16 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=81=EC=A4=91=EB=A5=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MyPageInvestment/MyPageInvestment.client.tsx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx b/src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx index 3a59787..d5fccec 100644 --- a/src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx +++ b/src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx @@ -101,8 +101,20 @@ export default function MyPageInvestmentClient() { }); const validScores = stockResult.stocks - .map((item: any) => item.cumulative_score) - .filter((score: any) => typeof score === "number"); + .map((item: any) => { + const predictCount = + investResult.find( + (s: any) => + s.stock_code === item.stock_code?._id || + s.stock_id === item._id + )?.scores?.length ?? 0; + + return predictCount > 0 && typeof item.cumulative_score === "number" + ? item.cumulative_score + : null; + }) + .filter((score: any) => score !== null); + const avg = validScores.length > 0 ? Math.round(