Skip to content

Commit

Permalink
hotfix/notification-createToken-1: 앞선 PR과 같은 문제 파악으로 member에 영속성 부여 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
KooSuYeon authored Nov 25, 2024
1 parent bc8c33c commit 189bb6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/dife/api/service/NotificationService.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ public NotificationTokenResponseDto sendNotificationToken(
notificationToken.setDeviceId(requestDto.getDeviceId());
notificationToken.setMember(member);

notificationTokenRepository.save(notificationToken);
member.getNotificationTokens().add(notificationToken);
memberRepository.save(member);

notificationTokenRepository.save(notificationToken);
return getNotificationResponseDto(notificationToken, member);
}
return modelMapper.map(
Expand Down Expand Up @@ -187,6 +188,7 @@ public boolean isTokenAlive(String pushToken, Member member, String deviceId) {

existingToken.setPushToken(pushToken);
notificationTokenRepository.save(existingToken);
memberRepository.save(member);

return true;
}
Expand Down

0 comments on commit 189bb6a

Please sign in to comment.