@@ -71,7 +71,9 @@ public List<RouteMissionRecommendationResponse> getRecommendationsByUserActiveSe
7171 return recommendations .stream ().map (recommendation -> {
7272 RouteMission routeMission = recommendation .getMission ();
7373 ClimbingGym gym = routeMission .getGym ();
74- List <UserMissionAttempt > attempts = routeMission .getAttempts ().stream ().toList ();
74+ List <UserMissionAttempt > userAttempts = routeMission .getAttempts ().stream ()
75+ .filter (attempt -> attempt .getUser ().getId ().equals (userId ))
76+ .toList ();
7577 Sector sector = routeMission .getSector ();
7678
7779 return RouteMissionRecommendationResponse .toDto (recommendation , routeMission , gym , attempts , sector , recommendation .getRecommendedOrder ());
@@ -84,6 +86,7 @@ public List<RouteMissionRecommendationResponse> getRecommendationsByUserAttempt(
8486 UserMissionAttempt attempt = userMissionAttemptRepository .findById (attemptId ).orElseThrow (AttemptNotFoundException ::new );
8587
8688 UserSession session = attempt .getSession ();
89+ Long userId = attempt .getUser ().getId ();
8790
8891 List <ChallengeRecommendation > recommendations = recommendationRepository .findBySession (session );
8992
@@ -108,7 +111,9 @@ public List<RouteMissionRecommendationResponse> getRecommendationsByUserAttempt(
108111
109112 RouteMission routeMission = recommendation .getMission ();
110113 ClimbingGym gym = routeMission .getGym ();
111- List <UserMissionAttempt > attempts = routeMission .getAttempts ().stream ().toList ();
114+ List <UserMissionAttempt > userAttempts = routeMission .getAttempts ().stream ()
115+ .filter (attemptRecord -> attemptRecord .getUser ().getId ().equals (userId ))
116+ .toList ();
112117 Sector sector = routeMission .getSector ();
113118
114119 recommendationResponseList .add (
0 commit comments