mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 22:44:29 +01:00
Greenfield: Fix Lightning transaction list return types
The LocalBTCPayServerClient deserializes the results as arrays (`LightningPaymentData[]` and `LightningInvoiceData[]`) — if they are `IEnumerable` the `GetFromActionResult` does not return the data but null.
This commit is contained in:
@@ -287,7 +287,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
var lightningClient = await GetLightningClient(cryptoCode, false);
|
||||
var param = new ListInvoicesParams { PendingOnly = pendingOnly, OffsetIndex = offsetIndex };
|
||||
var invoices = await lightningClient.ListInvoices(param, cancellationToken);
|
||||
return Ok(invoices.Select(ToModel));
|
||||
return Ok(invoices.Select(ToModel).ToArray());
|
||||
}
|
||||
|
||||
public virtual async Task<IActionResult> GetPayments(string cryptoCode, [FromQuery] bool? includePending, [FromQuery] long? offsetIndex, CancellationToken cancellationToken = default)
|
||||
@@ -295,7 +295,7 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||
var lightningClient = await GetLightningClient(cryptoCode, false);
|
||||
var param = new ListPaymentsParams { IncludePending = includePending, OffsetIndex = offsetIndex };
|
||||
var payments = await lightningClient.ListPayments(param, cancellationToken);
|
||||
return Ok(payments.Select(ToModel));
|
||||
return Ok(payments.Select(ToModel).ToArray());
|
||||
}
|
||||
|
||||
public virtual async Task<IActionResult> CreateInvoice(string cryptoCode, CreateLightningInvoiceRequest request, CancellationToken cancellationToken = default)
|
||||
|
||||
Reference in New Issue
Block a user