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

fix : 구독 중복 예외처리 #32

Merged
merged 1 commit into from
Nov 23, 2023
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 @@ -34,7 +34,15 @@ public SubscribeRes subscribe(String socialId,Long topicId, Long issueId) {
Member member = memberQueryService.getMemberBySocialId(socialId);

if (subscribeQueryService.isAbleToSubscribe(member)) {

if (member.getSubscribeList().stream()
.anyMatch(subscribe -> subscribe.getIssueId().equals(issueId))) {

throw new NoAccessSubscribe();

}
Subscribe save = subscribeSaveService.save(subscribeMapper.mapToSubscribe(member, issueId));
member.getSubscribeList().add(save);

// publishSubscribeChange.publishMemberChange();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ public interface SubscribeCustomRepository {




}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public SubscribeMemberDto findAllSubscribeByMember(Member member) {
.fetchOne();
}

public Subscribe findSubscribeByMemberAndTopic(Member member,Long issueId) {
public Subscribe findSubscribeByMemberAndTopic(Member member, Long issueId) {
return queryFactory
.select(subscribe)
.from(subscribe)
Expand Down Expand Up @@ -114,4 +114,9 @@ public List<SubscribeData> getIssueBySubscribers() {

}



}



Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,4 @@ public List<SubscribeData> getIssueBySubscribers() {
}





}