Refactor to use aerogo/database

This commit is contained in:
2017-10-27 09:11:56 +02:00
parent c0d7b0d2df
commit b07a98ed32
18 changed files with 52 additions and 164 deletions

View File

@ -66,21 +66,13 @@ func Success(ctx *aero.Context) string {
Created: arn.DateTimeUTC(),
}
err = payment.Save()
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Could not save payment in the database", err)
}
payment.Save()
// Increase user's balance
user.Balance += payment.Gems()
// Save in DB
err = user.Save()
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Could not save new balance", err)
}
user.Save()
// Notify admin
go func() {