diff --git a/src/main/java/org/sopt/app/presentation/user/UserWithdrawController.java b/src/main/java/org/sopt/app/presentation/user/UserWithdrawController.java index b1ce2aba..39ff9a48 100644 --- a/src/main/java/org/sopt/app/presentation/user/UserWithdrawController.java +++ b/src/main/java/org/sopt/app/presentation/user/UserWithdrawController.java @@ -41,12 +41,12 @@ public ResponseEntity logout( @AuthenticationPrincipal User user, @Valid @RequestBody PushTokenRequest.DeleteRequest deleteRequest ) { - PushToken targetPushToken = pushTokenService.getDeviceToken( - user.getId(), deleteRequest.getPushToken() - ); -// val result = - pushTokenService.deleteDeviceToken(targetPushToken); -// val response = pushTokenResponseMapper.ofStatus(result); + if (pushTokenService.isExistDeviceToken(user.getId(), deleteRequest.getPushToken())) { + PushToken targetPushToken = pushTokenService.getDeviceToken( + user.getId(), deleteRequest.getPushToken() + ); + pushTokenService.deleteDeviceToken(targetPushToken); + } return ResponseEntity.status(HttpStatus.OK).body(null); }