Skip to content
Permalink
Browse files

Fix bug in transaction listing for admins (#187)

  • Loading branch information...
mraerino committed Sep 10, 2019
1 parent fe0f2d7 commit ac25dbde857721c083eb7b42806a59a77af6d310
Showing with 6 additions and 1 deletion.
  1. +6 −1 api/payments.go
@@ -513,8 +513,13 @@ func queryForOrder(db *gorm.DB, orderID string, log logrus.FieldLogger) (*models
}

func queryForTransactions(db *gorm.DB, log logrus.FieldLogger, clause, id string) ([]models.Transaction, *HTTPError) {
params := []interface{}{}
if clause != "" {
params = []interface{}{clause, id}
}

trans := []models.Transaction{}
if rsp := db.Find(&trans, clause, id); rsp.Error != nil {
if rsp := db.Find(&trans, params...); rsp.Error != nil {
if rsp.RecordNotFound() {
return nil, notFoundError("Transactions not found")
}

0 comments on commit ac25dbd

Please sign in to comment.
You can’t perform that action at this time.