Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 삭제된 모임/모임원 리턴 되지 않도록 수정 #121

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,17 @@ public List<TeamServiceListResDto> teamServiceList(Long memberIdx) {

List<Team> teams = teamRepository.findTeamsByMemberIdx(memberIdx);

for(int i = 0; i < teams.size(); i++) {
Optional<TeamMember> teamMember= teamMemberRepository.findTeamMemberByMember_MemberIdxAndTeam_TeamIdx(memberIdx, teams.get(i).getTeamIdx());
if(teamMember.isPresent() && (teamMember.get().getTeamMemberState() == TeamMemberState.총무 || teamMember.get().getTeamMemberState() == TeamMemberState.모임원)) {
for (Team team : teams) {
if (team.getDeletedAt() != null || team.getDeletedBy()!=null ) continue;
Optional<TeamMember> teamMember = teamMemberRepository.findTeamMemberByMember_MemberIdxAndTeam_TeamIdx(memberIdx, team.getTeamIdx());
if (teamMember.isPresent() && (teamMember.get().getTeamMemberState() == TeamMemberState.총무 || teamMember.get().getTeamMemberState() == TeamMemberState.모임원)) {
Long teamMemberIdx = teamMember.get().getTeamMemberIdx();
TeamServiceListResDto teamServiceListResDto = TeamServiceListResDto.builder()
.accIdx(teams.get(i).getAccount().getAccIdx())
.accNumber(teams.get(i).getAccount().getAccNumber())
.accBalance(teams.get(i).getAccount().getAccBalance())
.teamName(teams.get(i).getTeamName())
.teamIdx(teams.get(i).getTeamIdx())
.accIdx(team.getAccount().getAccIdx())
.accNumber(team.getAccount().getAccNumber())
.accBalance(team.getAccount().getAccBalance())
.teamName(team.getTeamName())
.teamIdx(team.getTeamIdx())
.teamMemberIdx(teamMemberIdx)
.teamMemberState(teamMember.get().getTeamMemberState().name())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ public List<TeamMembersResDto> teamMembers(Long teamIdx) {
Team team = teamRepository.findById(teamIdx).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_NOT_FOUND));
List<TeamMember> teamMembers = teamMemberRepository.findTeamMembersByTeam(team);

for(int i = 0; i < teamMembers.size(); i++) {
for (TeamMember teamMember : teamMembers) {
if(teamMember.getDeletedBy()!=null || teamMember.getDeletedAt()!=null ) continue;

TeamMembersResDto teamMembersResDto = TeamMembersResDto.builder()
.teamMemberIdx(teamMembers.get(i).getTeamMemberIdx())
.memberName(teamMembers.get(i).getMember().getMemberName())
.teamMemberState(teamMembers.get(i).getTeamMemberState())
.memberIdx(teamMembers.get(i).getMember().getMemberIdx())
.teamMemberIdx(teamMember.getTeamMemberIdx())
.memberName(teamMember.getMember().getMemberName())
.teamMemberState(teamMember.getTeamMemberState())
.memberIdx(teamMember.getMember().getMemberIdx())
.build();

teamMembersResDtos.add(teamMembersResDto);
Expand Down
Loading