Skip to content

Commit

Permalink
refactor: store id in var before function call for clarify
Browse files Browse the repository at this point in the history
  • Loading branch information
C-limlim committed Feb 15, 2024
1 parent 6f7329e commit 3a6ee33
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/service/user.service.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func (service *UserServiceImpl) GetUser(uid string) (model.User, error) {
func (service *UserServiceImpl) UpdateUser(updateUserDTO map[string]interface{}) (model.User, error) {

ctx := context.Background()
uid := updateUserDTO["uid"].(string)
params := &auth.UserToUpdate{}
customClaims := make(map[string]interface{})

Expand All @@ -48,7 +49,7 @@ func (service *UserServiceImpl) UpdateUser(updateUserDTO map[string]interface{})
}
params = params.CustomClaims(customClaims)

userRecord, err := service.authClient.UpdateUser(ctx, updateUserDTO["uid"].(string), params)
userRecord, err := service.authClient.UpdateUser(ctx, uid, params)
if err != nil {
return model.User{}, err
}
Expand Down

0 comments on commit 3a6ee33

Please sign in to comment.