Skip to content

Commit

Permalink
Merge pull request #156 from Gongjakso/refactor/qa
Browse files Browse the repository at this point in the history
fix: 내가 모집중인 팀 조회 쿼리 수정
  • Loading branch information
dl-00-e8 authored May 23, 2024
2 parents 1138f3e + b0c9eaa commit da235e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public interface PostRepository extends JpaRepository<Post, Long> {
Page<Post> findAllPostsJoinedWithStackNamesByTitleContainsAndPostTypeTrueAndDeletedAtIsNullAndFinishDateAfterAndStatusAndMeetingCityContainsAndMeetingTownContainsAndStackNamesStackNameTypeContainsOrderByScrapCountDescPostIdDesc
(@Param("searchWord") String searchWord, @Param("currentTimestamp") LocalDateTime currentTimestamp, @Param("status") PostStatus status, @Param("meetingCity") String meetingCity, @Param("meetingTown") String meetingTown, @Param("stackNameType") String stackNameType,Pageable pageable);

List<Post> findAllByMemberAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(Member member, PostStatus status);
List<Post> findAllByMemberAndStatusInAndDeletedAtIsNullOrderByCreatedAtDesc(Member member, List<PostStatus> statusList);

Page<Post> findAllByPostIdInOrMember(List<Long> postIdList, Member member, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;

import static com.gongjakso.server.domain.post.enumerate.PostStatus.EXTENSION;
import static com.gongjakso.server.domain.post.enumerate.PostStatus.RECRUITING;
import static com.gongjakso.server.global.exception.ErrorCode.*;

Expand Down Expand Up @@ -336,7 +338,8 @@ public List<MyPageRes> getMyPostList(Member member) {
// Validation

// Business Logic
List<Post> postList = postRepository.findAllByMemberAndStatusAndDeletedAtIsNullOrderByCreatedAtDesc(member, RECRUITING);
List<PostStatus> statusList = Arrays.asList(RECRUITING, EXTENSION);
List<Post> postList = postRepository.findAllByMemberAndStatusInAndDeletedAtIsNullOrderByCreatedAtDesc(member, statusList);

// Return
return postList.stream()
Expand Down

0 comments on commit da235e4

Please sign in to comment.