diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateNicknameInfo.java b/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateNicknameInfo.java index 4d5d013d..b82a7a85 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateNicknameInfo.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateNicknameInfo.java @@ -7,12 +7,10 @@ public class UpdateNicknameInfo { private Long userId; private String nickname; - private boolean auth; @Builder - public UpdateNicknameInfo(Long userId, String nickname, boolean auth) { + public UpdateNicknameInfo(Long userId, String nickname) { this.userId = userId; this.nickname = nickname; - this.auth = auth; } } diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateNicknameRequest.java b/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateNicknameRequest.java index f594ec91..2130cd58 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateNicknameRequest.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateNicknameRequest.java @@ -15,15 +15,11 @@ public class UpdateNicknameRequest { @Size(max = 10, message = "닉네임은 10자 이하여야 합니다") private String nickname; - @Schema(description = "해당 유저가 기존 닉네임 중복검사를 실시했는지") - @NotNull(message = "접근권한이 없는 유저입니다") - private boolean auth; public UpdateNicknameInfo toService(Long userId) { return UpdateNicknameInfo.builder() .userId(userId) .nickname(nickname) - .auth(auth) .build(); } } diff --git a/src/main/java/kr/co/studyhubinu/studyhubserver/user/service/UserService.java b/src/main/java/kr/co/studyhubinu/studyhubserver/user/service/UserService.java index ef379c06..ae65789a 100644 --- a/src/main/java/kr/co/studyhubinu/studyhubserver/user/service/UserService.java +++ b/src/main/java/kr/co/studyhubinu/studyhubserver/user/service/UserService.java @@ -54,9 +54,6 @@ public GetUserResponse getUser(Long userId) { @Transactional public void updateNickname(UpdateNicknameInfo info) { UserEntity user = userRepository.findById(info.getUserId()).orElseThrow(UserNotFoundException::new); - if(!info.isAuth()) { - throw new UserNotAccessRightException(); - } user.updateNickname(info.getNickname()); } diff --git a/src/test/java/kr/co/studyhubinu/studyhubserver/user/service/UserServiceTest.java b/src/test/java/kr/co/studyhubinu/studyhubserver/user/service/UserServiceTest.java index c9a57883..74d27ab3 100644 --- a/src/test/java/kr/co/studyhubinu/studyhubserver/user/service/UserServiceTest.java +++ b/src/test/java/kr/co/studyhubinu/studyhubserver/user/service/UserServiceTest.java @@ -108,7 +108,6 @@ class UserServiceTest { UpdateNicknameInfo updateNicknameInfo = UpdateNicknameInfo.builder() .nickname("나사나이이영재") .userId(user.getId()) - .auth(true) .build(); BDDMockito.given(userRepository.findById(1L)).willReturn(Optional.ofNullable(user));