Skip to content

Commit

Permalink
[refactor] 친구의 펀딩아이템 조회 서비스 로직 수정(#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
hwan2-99 committed Jun 19, 2024
1 parent 3f3e835 commit bb89052
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,9 @@ public ProgressResponse getMyFundingProgress(String providerId) {
public ProgressResponse getFriendFundingProgress(String providerId, FriendFundingInquiryRequest inquiryRequest) {
Member self = findMemberByProviderId(providerId);
Member friend = findMemberByProviderId(inquiryRequest.getFriendProviderId()); //todo 친구 검증 메소드 추가해야함
Funding funding = fundingRepository.findByMemberIdAndStatus(friend.getMemberId(), FundingStatus.PROGRESS)
.orElse(null);

if (funding == null) {
return new ProgressResponse();
}
return getFundingProgress(funding.getFundingId(), friend.getMemberId());
return fundingRepository.findByMemberIdAndStatus(friend.getMemberId(), FundingStatus.PROGRESS)
.map(funding -> getFundingProgress(funding.getFundingId(), friend.getMemberId()))
.orElse(new ProgressResponse());
}

public PageResponse<?> getMyFilteredFundingProducts(String providerId, FundingStatus status,
Expand Down

0 comments on commit bb89052

Please sign in to comment.