Greenfield: Rename enabledOnly to enabled?

Allows the filter to work in both directions instead
This commit is contained in:
Kukks
2021-07-26 11:12:44 +02:00
committed by Andrew Camilleri
parent 4d538c61b1
commit f4df850d25
9 changed files with 94 additions and 41 deletions

View File

@@ -8,13 +8,19 @@ namespace BTCPayServer.Client
public partial class BTCPayServerClient
{
public virtual async Task<Dictionary<string, GenericPaymentMethodData>> GetStorePaymentMethods(string storeId,
bool enabledOnly = false,
bool? enabled = null,
CancellationToken token = default)
{
var query = new Dictionary<string, object>();
if (enabled != null)
{
query.Add(nameof(enabled), enabled);
}
var response =
await _httpClient.SendAsync(
CreateHttpRequest($"api/v1/stores/{storeId}/payment-methods",
new Dictionary<string, object>() {{nameof(enabledOnly), enabledOnly}}), token);
query), token);
return await HandleResponse<Dictionary<string, GenericPaymentMethodData>>(response);
}
}