Merge pull request #67 from getAlby/do-not-return-initialized-invoices

Do not return invoices that are in the initialized state
This commit is contained in:
Michael Bumann
2022-01-24 20:12:12 +02:00
committed by GitHub

View File

@@ -74,7 +74,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 = ?", invoiceType)
query.Where("type = ? AND state <> ?", invoiceType, "initialized")
}
query.OrderExpr("id DESC").Limit(100)
err := query.Scan(ctx)