diff --git a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java index 7c202eb..617a43b 100644 --- a/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java +++ b/backend/src/main/java/com/edufocus/edufocus/lecture/service/LectureServiceImpl.java @@ -224,19 +224,18 @@ public class LectureServiceImpl implements LectureService { Optional lecture = lectureRepository.findById(id); - Lecture l; - if (lecture.isPresent()) { - l = lecture.get(); - - System.out.println(l.isOnline()); - l.setOnline(true); - System.out.println(l.isOnline()); - - - } else { + if (!lecture.isPresent()) { throw new RuntimeException("Lecture not found with id: " + id); + } + + Lecture l; + l = lecture.get(); + l.setOnline(true); + + + lectureRepository.save(l); } diff --git a/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java b/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java index 3a06abc..f57de58 100644 --- a/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java +++ b/backend/src/main/java/com/edufocus/edufocus/user/controller/UserController.java @@ -57,10 +57,9 @@ public class UserController { // 비밀번호 변경 @PutMapping("/updatepassword") - public ResponseEntity updatePassword( - - @RequestBody PasswordDto passwordDto, HttpServletRequest request) { - try { + public ResponseEntity updatePassword(@RequestBody PasswordDto passwordDto, HttpServletRequest request) { + try + { String token = request.getHeader("Authorization"); Long userId = Long.parseLong(jwtUtil.getUserId(token));