فهرست منبع

기타 수정

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("권한이 없습니다");
         }