Skip to content

Commit 55849ab

Browse files
authored
Hotfix : 참여중인 파티에 모집완료 파티 조회되도록 수정 (#131)
* hotfix : 모집 완료 파티 조회 수정 * Hotfix : 참여중인 파티에 모집완료 파티 조회되도록 수정
1 parent b0630c2 commit 55849ab

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

src/main/java/ita/tinybite/domain/party/repository/PartyParticipantRepository.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ List<PartyParticipant> findActivePartiesByUserIdExcludingHost(
8181
@Param("participantStatus") ParticipantStatus participantStatus
8282
);
8383

84+
@Query("SELECT pp FROM PartyParticipant pp " +
85+
"JOIN FETCH pp.party p " +
86+
"JOIN FETCH p.host " +
87+
"WHERE pp.user.userId = :userId " +
88+
"AND p.host.userId != :userId " +
89+
"AND p.status IN :partyStatuses " +
90+
"AND pp.status = :participantStatus")
91+
List<PartyParticipant> findActivePartiesByUserIdExcludingHostAndStatusIn(
92+
@Param("userId") Long userId,
93+
@Param("partyStatuses") List<PartyStatus> partyStatuses,
94+
@Param("participantStatus") ParticipantStatus participantStatus
95+
);
96+
8497
int countByPartyIdAndStatusAndUser_UserIdNot(Long partyId, ParticipantStatus participantStatus, Long userId);
8598

8699
List<PartyParticipant> findAllByPartyAndStatus(Party party, ParticipantStatus status);

src/main/java/ita/tinybite/domain/user/service/UserService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ public List<PartyCardResponse> getHostingParties(Long userId, Double latitude, D
198198

199199
public List<PartyCardResponse> getParticipatingParties(Long userId, Double latitude, Double longitude) {
200200
List<PartyParticipant> participants = participantRepository
201-
.findActivePartiesByUserIdExcludingHost(
201+
.findActivePartiesByUserIdExcludingHostAndStatusIn(
202202
userId,
203-
PartyStatus.RECRUITING,
203+
Arrays.asList(PartyStatus.RECRUITING, PartyStatus.COMPLETED),
204204
ParticipantStatus.APPROVED
205205
);
206206

0 commit comments

Comments
 (0)