Skip to content

Commit

Permalink
Merge pull request #171 from lemonssoju/fix/122-getGroupList
Browse files Browse the repository at this point in the history
[fix/122-getGroupList] 멤버로 참여중인 그룹 목록 조회 시 삭제된 그룹은 제외하도록 수정
  • Loading branch information
JoongHyun-Kim authored Jun 3, 2024
2 parents 6ef84c7 + 1fd9db7 commit cba99a4
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public BaseResponse<GroupListResponse> getGroupList() {
User user = userRepository.findById(userService.getUserIdxWithValidation()).orElseThrow(() -> new BaseException(INVALID_USER_IDX));

List<Team> groupList_admin = groupRepository.findByAdminAndStatusEquals(user, ACTIVE);
List<Team> groupList_member = user.getUserTeams().stream().map(UserTeam::getTeam).toList();
List<Team> groupList_member = user.getUserTeams().stream()
.filter(userTeam -> "active".equals(userTeam.getStatus()))
.map(UserTeam::getTeam).toList();
List<Team> combinedGroupList = Stream.concat(groupList_admin.stream(), groupList_member.stream()).distinct().toList();

List<GroupListDto> groupListDto = combinedGroupList.stream()
Expand Down

0 comments on commit cba99a4

Please sign in to comment.