Skip to content

Commit

Permalink
✨ 커뮤니티 게시글 리스트 조회 권한 필수 제외
Browse files Browse the repository at this point in the history
  • Loading branch information
mangchhe committed Apr 19, 2024
1 parent f6cce38 commit d5747ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CommunityPostController(
private val communityPostUseCase: CommunityPostUseCase
) {

@Authentication
@Authentication(required = false)
@GetMapping("/v1/community-posts")
fun searchCommunityPosts(
pageable: Pageable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class CommunityPostService(
private val logger = NamedLogger("HASHTAG_LOGGER")

override fun searchCommunityPosts(command: SearchCommunityPostCommand): SearchCommunityPostDto.Response {
val userId = RequestUtils.getAttribute("memberId")!!
val userId: String? = RequestUtils.getAttribute("memberId")
val searchCommunityPosts = communityPostReader.searchCommunityPosts(command)
val posts = searchCommunityPosts
.map {
Expand Down Expand Up @@ -66,7 +66,8 @@ class CommunityPostService(
}

override fun getCommunityPost(command: GetCommunityPostCommand): GetCommunityPostDto.Response {
val communityPost = communityPostReader.getByCustom(command.id, RequestUtils.getAttribute("memberId"))
val userId: String? = RequestUtils.getAttribute("memberId")
val communityPost = communityPostReader.getByCustom(command.id, userId)
val views = viewsSupport.increase(command.id)
val hashTags = communityPostHashTagReader.findAllByPostId(communityPost.id).map { it.hashTag.name }
val communityPostFiles = communityPostFileReader.findAllByPostId(communityPost.id)
Expand Down

0 comments on commit d5747ae

Please sign in to comment.