Skip to content

Commit

Permalink
[backend] refact
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Jun 17, 2024
1 parent f5c7100 commit 2ad0abb
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ public static List<TeamSimple> rawTeamToSimplerTeam(List<RawTeam> teams,
}

private static Set<String> getInjectTeamsIds(final String teamId, Set<String> injectIds, final InjectRepository injectRepository) {
return injectRepository.findRawInjectTeams(injectIds).stream().filter(i-> i.getInject_teams().contains(teamId)).map(RawInjectTeam::getInject_id).collect(Collectors.toSet());
List<RawInjectTeam> rawInjectTeams = injectRepository.findRawInjectTeams(injectIds);

// Extract inject_ids that belong to the given teamId
return rawInjectTeams.stream()
.filter(rawInjectTeam -> rawInjectTeam.getInject_teams().contains(teamId))
.map(RawInjectTeam::getInject_id)
.collect(Collectors.toSet());
}

}

0 comments on commit 2ad0abb

Please sign in to comment.