Payments should use composite key (#6240)

* Payments should use composite key

* Invert PK for InvoiceAddress
This commit is contained in:
Nicolas Dorier
2024-09-23 17:06:56 +09:00
committed by GitHub
parent 36a5d0ee3f
commit 3cf1aa00fa
16 changed files with 98 additions and 36 deletions

View File

@@ -674,7 +674,7 @@ namespace BTCPayServer.Controllers
private async Task<HashSet<string>> GetAddresses(PaymentMethodId paymentMethodId, string[] selectedItems)
{
using var ctx = _dbContextFactory.CreateContext();
return new HashSet<string>(await ctx.AddressInvoices.Where(i => i.PaymentMethodId == paymentMethodId.ToString() && selectedItems.Contains(i.InvoiceDataId)).Select(i => i.Address).ToArrayAsync());
return new HashSet<string>(await ctx.AddressInvoices.Where(i => selectedItems.Contains(i.InvoiceDataId) && i.PaymentMethodId == paymentMethodId.ToString()).Select(i => i.Address).ToArrayAsync());
}
[HttpGet("i/{invoiceId}")]