mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-01-04 21:45:30 +01:00
fix: exclude erroneous payments (#467)
* fix: exclude errorneous payments * fix: add invoicesfor in tests --------- Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
This commit is contained in:
@@ -268,7 +268,7 @@ func (svc *LndhubService) InvoicesFor(ctx context.Context, userId int64, invoice
|
||||
|
||||
query := svc.DB.NewSelect().Model(&invoices).Where("user_id = ?", userId)
|
||||
if invoiceType != "" {
|
||||
query.Where("type = ? AND state <> ?", invoiceType, common.InvoiceStateInitialized)
|
||||
query.Where("type = ? AND state NOT IN(?, ?)", invoiceType, common.InvoiceStateInitialized, common.InvoiceStateError)
|
||||
}
|
||||
query.OrderExpr("id DESC").Limit(100)
|
||||
err := query.Scan(ctx)
|
||||
|
||||
Reference in New Issue
Block a user