Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

친구의 펀딩아이템 조회시 불필요한 과정 삭제 #288

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ public ResponseEntity<?> checkFunding(@RequestBody FundingCheckRequest checkRequ
return ResponseEntity.ok(response);
}

@GetMapping("/funding/{fundingId}")
public ResponseEntity<?> getFundingProgress(@PathVariable Long fundingId, @LoggedInMember String providerId) {
ProgressResponse response = fundingService.getFundingItemProgress(fundingId, providerId);
return ResponseEntity.ok(response);
}

@PostMapping("/funding/friendItem")
public ResponseEntity<?> getFriendFundingProgress(@LoggedInMember String providerId, @RequestBody
FriendFundingInquiryRequest inquiryRequest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@
@Getter
@Builder
public class FriendFundingInquiryRequest {
private final Long fundingId;
private final String friendProviderId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +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 = findByIdAndMemberId(inquiryRequest.getFundingId(), friend.getMemberId());

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
Loading