Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0517 alpha test 수정사항 반영 #52

Merged
merged 2 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/usecase/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func (u *UserUsecase) UpdateByAccountIdByAdmin(ctx context.Context, accountId st
if err != nil {
return nil, err
}
if *originUser.Email != user.Email {
if originUser.Email == nil || *originUser.Email != user.Email {
originUser.Email = gocloak.StringP(user.Email)
err = u.kc.UpdateUser(userInfo.GetOrganizationId(), originUser)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/domain/organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Organization = struct {
}

type CreateOrganizationRequest struct {
Name string `json:"name" validate:"required,min=3,max=20"`
Name string `json:"name" validate:"required,min=1,max=30"`
Description string `json:"description" validate:"omitempty,min=0,max=100"`
Phone string `json:"phone"`
}
Expand Down Expand Up @@ -101,7 +101,7 @@ type ListOrganizationBody struct {

type UpdateOrganizationRequest struct {
PrimaryClusterId string `json:"primaryClusterId"`
Name string `json:"name" validate:"required,min=3,max=20"`
Name string `json:"name" validate:"required,min=1,max=30"`
Description string `json:"description" validate:"omitempty,min=0,max=100"`
Phone string `json:"phone"`
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/domain/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ type Policy = struct {
type CreateUserRequest struct {
AccountId string `json:"accountId" validate:"required"`
Password string `json:"password" validate:"required"`
Name string `json:"name" validate:"min=0,max=20"`
Name string `json:"name" validate:"min=1,max=30"`
Email string `json:"email" validate:"required,email"`
Department string `json:"department" validate:"min=0,max=20"`
Department string `json:"department" validate:"min=0,max=50"`
Role string `json:"role" validate:"required,oneof=admin user"`
Description string `json:"description" validate:"min=0,max=100"`
}
Expand Down Expand Up @@ -111,10 +111,10 @@ type ListUserBody struct {
}

type UpdateUserRequest struct {
Name string `json:"name" validate:"omitempty,min=0,max=20"`
Name string `json:"name" validate:"omitempty,min=1,max=30"`
Role string `json:"role" validate:"oneof=admin user"`
Email string `json:"email" validate:"omitempty,email"`
Department string `json:"department" validate:"omitempty,min=0,max=20"`
Department string `json:"department" validate:"omitempty,min=0,max=50"`
Description string `json:"description" validate:"omitempty,min=0,max=100"`
}

Expand Down Expand Up @@ -146,9 +146,9 @@ type GetMyProfileResponse struct {
}
type UpdateMyProfileRequest struct {
Password string `json:"password" validate:"required"`
Name string `json:"name" validate:"omitempty,min=0,max=20"`
Name string `json:"name" validate:"omitempty,min=1,max=30"`
Email string `json:"email" validate:"omitempty,email"`
Department string `json:"department" validate:"omitempty,min=0,max=20"`
Department string `json:"department" validate:"omitempty,min=0,max=50"`
}

type UpdateMyProfileResponse struct {
Expand Down