Dotnet reformat

This commit is contained in:
nicolas.dorier
2023-04-10 11:07:03 +09:00
parent f598c70a4f
commit 7546ef7a8e
110 changed files with 518 additions and 486 deletions

View File

@@ -33,7 +33,10 @@ namespace BTCPayServer.Controllers.Greenfield
return new LightningAddressData();
return new LightningAddressData()
{
Username = data.Username, Max = blob.Max, Min = blob.Min, CurrencyCode = blob.CurrencyCode
Username = data.Username,
Max = blob.Max,
Min = blob.Min,
CurrencyCode = blob.CurrencyCode
};
}
@@ -41,7 +44,7 @@ namespace BTCPayServer.Controllers.Greenfield
[HttpGet("~/api/v1/stores/{storeId}/lightning-addresses")]
public async Task<IActionResult> GetStoreLightningAddresses(string storeId)
{
return Ok((await _lightningAddressService.Get(new LightningAddressQuery() {StoreIds = new[] {storeId}}))
return Ok((await _lightningAddressService.Get(new LightningAddressQuery() { StoreIds = new[] { storeId } }))
.Select(ToModel).ToArray());
}
@@ -64,7 +67,8 @@ namespace BTCPayServer.Controllers.Greenfield
{
var res = await _lightningAddressService.Get(new LightningAddressQuery()
{
Usernames = new[] {username}, StoreIds = new[] {storeId},
Usernames = new[] { username },
StoreIds = new[] { storeId },
});
return res?.Any() is true ? Ok(ToModel(res.First())) : this.CreateAPIError(404, "lightning-address-not-found", "The lightning address was not present.");
}
@@ -79,17 +83,17 @@ namespace BTCPayServer.Controllers.Greenfield
ModelState.AddModelError(nameof(data.Min), "Minimum must be greater than 0 if provided.");
return this.CreateValidationError(ModelState);
}
if (await _lightningAddressService.Set(new Data.LightningAddressData()
{
StoreDataId = storeId,
Username = username
}.SetBlob(new LightningAddressDataBlob()
{
Max = data.Max,
Min = data.Min,
CurrencyCode = data.CurrencyCode
})))
{
StoreDataId = storeId,
Username = username
}.SetBlob(new LightningAddressDataBlob()
{
Max = data.Max,
Min = data.Min,
CurrencyCode = data.CurrencyCode
})))
{
return await GetStoreLightningAddress(storeId, username);
}