diff --git a/handler/transaction.go b/handler/transaction.go
index 78c5a46..9768c90 100644
--- a/handler/transaction.go
+++ b/handler/transaction.go
@@ -53,6 +53,7 @@ func (h TransactionImpl) handleTransactionPage() http.HandlerFunc {
filter := types.TransactionItemsFilter{
AccountId: r.URL.Query().Get("account-id"),
TreasureChestId: r.URL.Query().Get("treasure-chest-id"),
+ Error: r.URL.Query().Get("error"),
}
transactions, err := h.s.GetAll(user, filter)
diff --git a/service/transaction.go b/service/transaction.go
index cf628c2..6e49440 100644
--- a/service/transaction.go
+++ b/service/transaction.go
@@ -254,7 +254,12 @@ func (s TransactionImpl) GetAll(user *types.User, filter types.TransactionItemsF
WHERE user_id = ?
AND (? = '' OR account_id = ?)
AND (? = '' OR treasure_chest_id = ?)
- ORDER BY timestamp DESC`, user.Id, filter.AccountId, filter.AccountId, filter.TreasureChestId, filter.TreasureChestId)
+ AND (? = ''
+ OR (? = "true" AND error IS NOT NULL)
+ OR (? = "false" AND error IS NULL)
+ )
+ ORDER BY timestamp DESC`,
+ user.Id, filter.AccountId, filter.AccountId, filter.TreasureChestId, filter.TreasureChestId, filter.Error, filter.Error, filter.Error)
err = db.TransformAndLogDbError("transaction GetAll", nil, err)
if err != nil {
return nil, err
diff --git a/template/transaction/transaction.templ b/template/transaction/transaction.templ
index 2faea53..d141443 100644
--- a/template/transaction/transaction.templ
+++ b/template/transaction/transaction.templ
@@ -41,6 +41,17 @@ templ Transaction(items templ.Component, filter types.TransactionItemsFilter, ac
}
}
+