소스 검색

기타 수정

sangwonlee 3 년 전
부모
커밋
ccb8dba17d
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      realworld/src/main/java/com/dbs/realworld/controller/UserController.java

+ 2 - 4
realworld/src/main/java/com/dbs/realworld/controller/UserController.java

@@ -109,8 +109,7 @@ public class UserController {
     // 사용자 팔로우
     @PostMapping("/follow")
     public ResponseEntity follow(HttpServletRequest request, @RequestBody FollowDTO followDTO) {
-        // final int userId = (int) request.getSession().getAttribute("ssId");
-        final int userId = 1;
+        final int userId = (int) request.getSession().getAttribute("ssId");
         if (userId != followDTO.getFromUser()) {
             return ResponseEntity.status(HttpStatus.FORBIDDEN).body("권한이 없습니다");
         }
@@ -121,8 +120,7 @@ public class UserController {
     // 사용자 언팔로우
     @DeleteMapping("/unfollow")
     public ResponseEntity unfollow(HttpServletRequest request, @RequestBody FollowDTO followDTO) {
-        // final int userId = (int) request.getSession().getAttribute("ssId");
-        final int userId = 1;
+        final int userId = (int) request.getSession().getAttribute("ssId");
         if (userId != followDTO.getFromUser()) {
             return ResponseEntity.status(HttpStatus.FORBIDDEN).body("권한이 없습니다");
         }