From 42b11de1f0003098071e5c5aa6fe9cee91e51ac3 Mon Sep 17 00:00:00 2001 From: eojin0814 Date: Thu, 23 Nov 2023 23:15:18 +0900 Subject: [PATCH] fix : subscribe --- .../gwangjang/server/domain/member/domain/entity/Member.java | 4 ++-- .../subscribe/application/service/UnSubscribeUseCase.java | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/gwangjang/server/domain/member/domain/entity/Member.java b/src/main/java/gwangjang/server/domain/member/domain/entity/Member.java index 43276f2..ae19d65 100644 --- a/src/main/java/gwangjang/server/domain/member/domain/entity/Member.java +++ b/src/main/java/gwangjang/server/domain/member/domain/entity/Member.java @@ -57,8 +57,8 @@ public class Member { private String birth; private String gender; -// @OneToMany(fetch = FetchType.LAZY) -// private List subscribeList = new ArrayList<>(); + @OneToMany(fetch = FetchType.LAZY) + private List subscribeList = new ArrayList<>(); public void signUp(SignUpRequest signUpRequest) { this.nickname = signUpRequest.getNickname(); diff --git a/src/main/java/gwangjang/server/domain/subscribe/application/service/UnSubscribeUseCase.java b/src/main/java/gwangjang/server/domain/subscribe/application/service/UnSubscribeUseCase.java index 3279fcb..2f7427b 100644 --- a/src/main/java/gwangjang/server/domain/subscribe/application/service/UnSubscribeUseCase.java +++ b/src/main/java/gwangjang/server/domain/subscribe/application/service/UnSubscribeUseCase.java @@ -28,6 +28,7 @@ public SubscribeRes unSubscribe(String socialId, Long topicId, Long issueId) { Member member = memberQueryService.getMemberBySocialId(socialId); Subscribe subscribe = subscribeQueryService.findSubscribeByMemberAndTopic(member, topicId,issueId); subscribeDeleteService.delete(subscribe); + member.getSubscribeList().remove(subscribe); return subscribeMapper.mapToSubscribeRes(subscribe).setUnScribe(subscribeQueryService.getSubscribers(issueId)); } }