Skip to content

Commit

Permalink
fix: 유저 정보 업데이트시 프로필 이미지 경로도 변경 가능하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Lujaec committed Mar 22, 2024
1 parent 2139448 commit 372860b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
public class UserInfoUpdateDto {
private Long userId;
private String nickName;
private String profileImageUrl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
@Getter
@Setter
public class UserInfoUpdateRequest {
@NotNull
private String nickName;
private String profileImageUrl;
}
7 changes: 6 additions & 1 deletion src/main/java/com/teamkrews/User/service/UserService.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ public Boolean isDuplicatedLoginId(String loginId){
@Transactional
public User update(UserInfoUpdateDto dto) {
User user = getById(dto.getUserId());
user.setNickName(dto.getNickName());

if(dto.getNickName() != null)
user.setNickName(dto.getNickName());
if(dto.getProfileImageUrl() != null)
user.setProfileImageUrl(dto.getProfileImageUrl());

return user;
}
}

0 comments on commit 372860b

Please sign in to comment.