Skip to content

Commit

Permalink
Feat(#229): 마이페이지에서 팀 대시보드 내가 참여한 것도 보이도록 수정 (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
inhooo00 authored Nov 28, 2024
1 parent 214de75 commit 69f351e
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static shop.kkeujeok.kkeujeokbackend.dashboard.team.domain.QTeamDashboardMemberMapping.teamDashboardMemberMapping;
import static shop.kkeujeok.kkeujeokbackend.member.domain.QMember.member;

import com.querydsl.jpa.JPAExpressions;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.util.List;
import java.util.Set;
Expand Down Expand Up @@ -76,7 +77,16 @@ public Set<String> findCategoriesForDashboard(Member member) {
public Page<TeamDashboard> findForTeamDashboard(Member member, Pageable pageable) {
long total = queryFactory
.selectFrom(teamDashboard)
.where(teamDashboard._super.member.eq(member))
.where(
teamDashboard._super.member.eq(member)
.or(
teamDashboard.id.in(
JPAExpressions.select(teamDashboardMemberMapping.teamDashboard.id)
.from(teamDashboardMemberMapping)
.where(teamDashboardMemberMapping.member.id.eq(member.getId()))
)
)
)
.stream()
.count();

Expand Down

0 comments on commit 69f351e

Please sign in to comment.