feat(transaction): #66 implement transactions
This commit was merged in pull request #72.
This commit is contained in:
@@ -170,6 +170,13 @@ func (db AuthSqlite) DeleteUser(userId uuid.UUID) error {
|
||||
return types.ErrInternal
|
||||
}
|
||||
|
||||
_, err = tx.Exec("DELETE FROM \"transaction\" WHERE user_id = ?", userId)
|
||||
if err != nil {
|
||||
_ = tx.Rollback()
|
||||
log.Error("Could not delete user: %v", err)
|
||||
return types.ErrInternal
|
||||
}
|
||||
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
log.Error("Could not commit transaction: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user