return the result on transaction

This commit is contained in:
Lunny Xiao 2020-06-26 18:28:48 +08:00
parent cc7d219065
commit 46244dafde
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 2 additions and 2 deletions

View File

@ -1263,11 +1263,11 @@ func (engine *Engine) Transaction(f func(*Session) (interface{}, error)) (interf
result, err := f(session)
if err != nil {
return nil, err
return result, err
}
if err := session.Commit(); err != nil {
return nil, err
return result, err
}
return result, nil