Skip to content

Commit

Permalink
Merge pull request #237 from kookmin-sw/hotfix-500
Browse files Browse the repository at this point in the history
[fix] 매칭 요청 취소, 거절 시 list에서 해당 항목 삭제
  • Loading branch information
tmdtmdqorekf authored May 15, 2024
2 parents 506a1bf + 1db84c0 commit 2d84e01
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ public MatchDto acceptMatchRequest(MatchIdDto dto) {
Object receiver = redisTemplate.opsForHash().get(key, "receiverId");
Long receiverId = getLongId(receiver);

redisTemplate.opsForList().remove("receiverId:" + receiverId, 1, dto.getMatchId());

// 알림
User toUser = userRepository.findByUserId(senderId).orElseThrow();
fcmService.sendPushMessageTo(toUser.getDeviceToken(), "커피챗 매칭 성공", "커피챗이 성사되었습니다.");
Expand Down Expand Up @@ -199,6 +201,7 @@ public MatchDto declineMatchRequest(MatchIdDto dto) {
fcmService.sendPushMessageTo(toUser.getDeviceToken(), "커피챗 매칭 실패", "커피챗 요청이 거절되었습니다.");

redisTemplate.delete(key);
redisTemplate.opsForList().remove("receiverId:" + receiverId, 1, dto.getMatchId());

// 락 해제
String lockKey = LOCK_KEY_PREFIX + senderId;
Expand Down Expand Up @@ -226,6 +229,7 @@ public MatchDto cancelMatchRequest(MatchIdDto dto) {
Long receiverId = getLongId(receiver);

redisTemplate.delete(key);
redisTemplate.opsForList().remove("receiverId:" + receiverId, 1, dto.getMatchId());

// 락 해제
String lockKey = LOCK_KEY_PREFIX + senderId;
Expand Down

0 comments on commit 2d84e01

Please sign in to comment.