Skip to content

Commit

Permalink
Merge pull request #86 from FoodZero/bug/85
Browse files Browse the repository at this point in the history
πŸ› [bug] κ²Œμ‹œκΈ€ λͺ©λ‘ 쑰회 λ‹‰λ„€μž„ 였λ₯˜ μˆ˜μ • #85
  • Loading branch information
Lee-Yeonjoo authored Sep 30, 2024
2 parents 40891b4 + f447630 commit 995b507
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static PostResponseDTO.PostListDTO toPostList(List<Post> postList, Member
.title(post.getTitle())
.status(post.getStatus())
.content(post.getContent())
.nickname(member.getNickname())
.nickname(post.getMember().getNickname())
.createdAt(post.getCreatedAt())
.itemImgUrlList(imgs)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.sm.project.domain.member.Location;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

Expand All @@ -22,5 +23,5 @@ public interface PostRepository extends JpaRepository<Post, Long> {
* @return κ²Œμ‹œκΈ€ λͺ©λ‘
*/
@Query("SELECT p FROM Post p WHERE (:postTopicType IS NULL OR p.topic = :postTopicType) AND p.id > :lastIndex AND (:location IS NULL OR p.location = :location) ORDER BY p.id ASC")
List<Post> findPostList(Long lastIndex, PostTopicType postTopicType, Location location);
List<Post> findPostList(@Param("lastIndex") Long lastIndex, @Param("postTopicType") PostTopicType postTopicType, @Param("location") Location location);
}

0 comments on commit 995b507

Please sign in to comment.