mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
Improve store/selectlist labeling (#3014)
This commit is contained in:
parent
5318684e5c
commit
0558631982
@ -83,8 +83,8 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
|
||||
var store = new Data.StoreData();
|
||||
|
||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId);
|
||||
ToModel(request, store, defaultPaymnetMethodId);
|
||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId);
|
||||
ToModel(request, store, defaultPaymentMethodId);
|
||||
await _storeRepository.CreateStore(_userManager.GetUserId(User), store);
|
||||
return Ok(FromModel(store));
|
||||
}
|
||||
@ -104,9 +104,9 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
return validationResult;
|
||||
}
|
||||
|
||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId);
|
||||
PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId);
|
||||
|
||||
ToModel(request, store, defaultPaymnetMethodId);
|
||||
ToModel(request, store, defaultPaymentMethodId);
|
||||
await _storeRepository.UpdateStore(store);
|
||||
return Ok(FromModel(store));
|
||||
}
|
||||
@ -193,7 +193,7 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(request.DefaultPaymentMethod) &&
|
||||
!PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymnetMethodId))
|
||||
!PaymentMethodId.TryParse(request.DefaultPaymentMethod, out var defaultPaymentMethodId))
|
||||
{
|
||||
ModelState.AddModelError(nameof(request.Name), "DefaultPaymentMethod is invalid");
|
||||
}
|
||||
|
@ -63,6 +63,7 @@ namespace BTCPayServer.Models.InvoicingModels
|
||||
get; set;
|
||||
}
|
||||
|
||||
[DisplayName("Store")]
|
||||
public SelectList Stores
|
||||
{
|
||||
get; set;
|
||||
|
@ -61,7 +61,9 @@ namespace BTCPayServer.Models.PaymentRequestViewModels
|
||||
[Required] public string Title { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
||||
[Display(Name = "Store")]
|
||||
public SelectList Stores { get; set; }
|
||||
|
||||
[EmailAddress]
|
||||
public string Email { get; set; }
|
||||
|
||||
|
@ -24,6 +24,7 @@ namespace BTCPayServer.Models.StoreViewModels
|
||||
get; set;
|
||||
}
|
||||
|
||||
[Display(Name = "Store")]
|
||||
public SelectList Stores
|
||||
{
|
||||
get; set;
|
||||
|
@ -70,7 +70,7 @@
|
||||
<span asp-validation-for="NotificationUrl" class="text-danger"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="StoreId" class="form-label"></label>
|
||||
<label asp-for="Stores" class="form-label"></label>
|
||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||
<span asp-validation-for="StoreId" class="text-danger"></span>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<input type="hidden" name="Id" value="@Model.Id" />
|
||||
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="StoreId" class="form-label"></label>
|
||||
<label asp-for="Stores" class="form-label"></label>
|
||||
@if (string.IsNullOrEmpty(Model.Id))
|
||||
{
|
||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||
|
@ -32,7 +32,7 @@
|
||||
@if (ViewBag.ShowStores)
|
||||
{
|
||||
<div class="form-group">
|
||||
<label asp-for="StoreId" class="form-label"></label>
|
||||
<label asp-for="Stores" class="form-label"></label>
|
||||
<select asp-for="StoreId" asp-items="Model.Stores" class="form-select"></select>
|
||||
<span asp-validation-for="StoreId" class="text-danger"></span>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user