mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-02 14:53:55 +08:00
fix: 修复用户更新不生效
This commit is contained in:
@@ -253,10 +253,11 @@ func (r *UserRepo) Update(ctx context.Context, id string, fn func(*db.User, *db.
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := fn(u, u.Update()); err != nil {
|
||||
up := tx.User.UpdateOneID(u.ID)
|
||||
if err = fn(u, up); err != nil {
|
||||
return err
|
||||
}
|
||||
return u.Update().Exec(ctx)
|
||||
return up.Exec(ctx)
|
||||
})
|
||||
return u, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user