Skip to content

Commit

Permalink
fix : redirect url 변경 주의
Browse files Browse the repository at this point in the history
  • Loading branch information
seungueonn committed Sep 16, 2023
1 parent 7e3a7d6 commit 4c3493d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/gip/sever/controller/HeartController.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public class HeartController {
private final MemberRepository memberRepository;

@PostMapping("/toggle/{productId}")
public ResponseEntity<SuccessResponse<String>> toggleHeart(HttpServletRequest request, @PathVariable(name = "productId") Long productId) {

// SessionUser user = (SessionUser) httpSession.getAttribute("user");
public ResponseEntity<SuccessResponse<String>> toggleHeart(HttpServletRequest request, @PathVariable(name = "productId") Long productId) throws Exception {
SessionUser user = (SessionUser) request.getSession(true).getAttribute("user");

Member member = memberRepository.findByEmail(user.getEmail()).orElseThrow();
Expand Down

0 comments on commit 4c3493d

Please sign in to comment.