diff --git a/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java b/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java index 831e18d..aadebeb 100644 --- a/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java +++ b/src/main/java/site/billbill/apiserver/api/borrowPosts/converter/PostsConverter.java @@ -98,7 +98,7 @@ public static PostsResponse.ReviewResponse toReview(ItemsReviewJpaEntity review) public static PostsResponse.ReviewsResponse toReviews(List reviews){ return PostsResponse.ReviewsResponse.builder().reviews(reviews).build(); } - public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, ItemsBorrowJpaEntity borrowItem, String status,UserJpaEntity user){ + public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, ItemsBorrowJpaEntity borrowItem, String status){ return PostsResponse.ViewPostResponse.builder() .postId(item.getId()) .title(item.getTitle()) @@ -110,8 +110,8 @@ public static PostsResponse.ViewPostResponse toViewPost(ItemsJpaEntity item, Ite .itemStatus(status) .categoryId(item.getCategory().getId()) .categoryName(item.getCategory().getName()) - .userId(user.getUserId()) - .userName(user.getNickname()) + .userId(item.getOwner().getUserId()) + .userName(item.getOwner().getNickname()) .build(); } public static PostsResponse.NoRentalPeriodResponse toOwnerNoRentalPeriod(ItemsBorrowStatusJpaEntity borrowStatus){ diff --git a/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java b/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java index 66cbb35..db90d1f 100644 --- a/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java +++ b/src/main/java/site/billbill/apiserver/api/borrowPosts/service/PostsServiceImpl.java @@ -119,7 +119,7 @@ public PostsResponse.ViewPostResponse ViewPostService(String postId, String user break; } - return PostsConverter.toViewPost(item, borrowItem, status, user); + return PostsConverter.toViewPost(item, borrowItem, status); }