Skip to content

Commit

Permalink
feat: 유저 닉네임 입력 시 앞뒤 공백 문자 무시 로직 추가 #166
Browse files Browse the repository at this point in the history
  • Loading branch information
seungyeop-lee committed Jul 22, 2024
1 parent b6b0270 commit 7d601fc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public CommonApiResponse<Void> updateInfo(
@AuthenticationPrincipal VookLoginUser loginUser,
@Validated @RequestBody UserUpdateInfoRequest request
) {
userLogic.updateInfo(loginUser.getUid(), request.nickname());
userLogic.updateInfo(loginUser.getUid(), request.nickname().trim());
return CommonApiResponse.ok();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import vook.server.api.domain.user.logic.UserRegisterCommand;

public record UserRegisterRequest(
@NotBlank
@Size(min = 1, max = 10)
String nickname,

@NotNull
Expand All @@ -23,7 +21,7 @@ public record UserRegisterRequest(
public UserRegisterCommand toCommand(String userUid) {
return UserRegisterCommand.builder()
.userUid(userUid)
.nickname(nickname)
.nickname(nickname.trim())
.marketingEmailOptIn(marketingEmailOptIn)
.build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package vook.server.api.web.user.reqres;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

public record UserUpdateInfoRequest(
@NotBlank
@Size(min = 1, max = 10)
String nickname
) {
}

0 comments on commit 7d601fc

Please sign in to comment.