Skip to content

Commit 7f885b3

Browse files
committed
chore(user): changes in password field name
1 parent 81f9a2b commit 7f885b3

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

module/user/infrastructure/repository/UserCommandRepository.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (repository *UserCommandRepository) UpdateUserEmailVerifiedAt(email string)
8484
func (repository *UserCommandRepository) UpdateUserPassword(data repositoryTypes.UpdateUserPassword) error {
8585
user := &entity.User{
8686
WalletAddress: data.WalletAddress,
87-
Password: data.NewPassword,
87+
Password: data.Password,
8888
}
8989

9090
// update users

module/user/infrastructure/repository/types/dto.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ type UpdateUser struct {
1515
}
1616

1717
type UpdateUserPassword struct {
18-
WalletAddress string
19-
CurrentPassword string
20-
NewPassword string
18+
WalletAddress string
19+
Password string
2120
}

module/user/infrastructure/service/UserCommandService.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ func (service *UserCommandService) UpdateUserEmailVerifiedAt(ctx context.Context
136136

137137
// UpdateUserPassword update user password by address
138138
func (service *UserCommandService) UpdateUserPassword(ctx context.Context, data types.UpdateUserPassword) error {
139-
hashedPassword, err := password.HashPassword(data.NewPassword)
139+
hashedPassword, err := password.HashPassword(data.Password)
140140
if err != nil {
141141
return err
142142
}
143143

144144
err = service.UserCommandRepositoryInterface.UpdateUserPassword(repositoryTypes.UpdateUserPassword{
145145
WalletAddress: data.WalletAddress,
146-
NewPassword: hashedPassword,
146+
Password: hashedPassword,
147147
})
148148
if err != nil {
149149
return err

module/user/infrastructure/service/types/dto.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ type UpdateUser struct {
1919

2020
type UpdateUserPassword struct {
2121
WalletAddress string
22-
NewPassword string
22+
Password string
2323
}

module/user/interfaces/http/rest/UserCommandController.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ func (controller *UserCommandController) UpdateUserPassword(w http.ResponseWrite
338338

339339
err = controller.UserCommandServiceInterface.UpdateUserPassword(context.TODO(), serviceTypes.UpdateUserPassword{
340340
WalletAddress: walletAddress,
341-
NewPassword: request.Password,
341+
Password: request.Password,
342342
})
343343
if err != nil {
344344
var httpCode int

0 commit comments

Comments
 (0)