Skip to content

Commit 78701e1

Browse files
Merge pull request #141 from InserToken/feat/82-financialChart
Feat/82 financial chart
2 parents 7ea4ed9 + 9eba5b7 commit 78701e1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,20 @@ export default function MyPageInvestmentClient() {
101101
});
102102

103103
const validScores = stockResult.stocks
104-
.map((item: any) => item.cumulative_score)
105-
.filter((score: any) => typeof score === "number");
104+
.map((item: any) => {
105+
const predictCount =
106+
investResult.find(
107+
(s: any) =>
108+
s.stock_code === item.stock_code?._id ||
109+
s.stock_id === item._id
110+
)?.scores?.length ?? 0;
111+
112+
return predictCount > 0 && typeof item.cumulative_score === "number"
113+
? item.cumulative_score
114+
: null;
115+
})
116+
.filter((score: any) => score !== null);
117+
106118
const avg =
107119
validScores.length > 0
108120
? Math.round(

0 commit comments

Comments
 (0)