mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Improve UpdateUserToOriginalDatabase().
This commit is contained in:
parent
eca1d23e35
commit
cc47f3b65d
@ -114,8 +114,7 @@ func (c *ApiController) UpdateUser() {
|
||||
|
||||
affected := object.UpdateUser(id, &user)
|
||||
if affected {
|
||||
newUser := object.GetUser(user.GetId())
|
||||
original.UpdateUserToOriginalDatabase(newUser)
|
||||
original.UpdateUserToOriginalDatabase(&user)
|
||||
}
|
||||
|
||||
c.Data["json"] = wrapActionResponse(affected)
|
||||
|
@ -53,7 +53,9 @@ func UpdateUserToOriginalDatabase(user *object.User) {
|
||||
return
|
||||
}
|
||||
|
||||
updatedOUser := createOriginalUserFromUser(user)
|
||||
newUser := object.GetUser(user.GetId())
|
||||
|
||||
updatedOUser := createOriginalUserFromUser(newUser)
|
||||
updateUser(updatedOUser)
|
||||
fmt.Printf("Update from user to oUser: %v\n", updatedOUser)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user