We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 7ea4ed9 + 9eba5b7 commit 78701e1Copy full SHA for 78701e1
src/components/blocks/MyPageInvestment/MyPageInvestment.client.tsx
@@ -101,8 +101,20 @@ export default function MyPageInvestmentClient() {
101
});
102
103
const validScores = stockResult.stocks
104
- .map((item: any) => item.cumulative_score)
105
- .filter((score: any) => typeof score === "number");
+ .map((item: any) => {
+ 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
118
const avg =
119
validScores.length > 0
120
? Math.round(
0 commit comments