use nameof

This commit is contained in:
Kukks
2020-03-26 12:39:19 +01:00
parent 886510c2e1
commit 23b2f55b47
2 changed files with 4 additions and 4 deletions

View File

@@ -673,7 +673,7 @@ namespace BTCPayServer.Controllers
private IActionResult ViewVault(WalletId walletId, PSBT psbt) private IActionResult ViewVault(WalletId walletId, PSBT psbt)
{ {
return View("WalletSendVault", new WalletSendVaultModel() return View(nameof(WalletSendVault), new WalletSendVaultModel()
{ {
WalletId = walletId.ToString(), WalletId = walletId.ToString(),
PSBT = psbt.ToBase64(), PSBT = psbt.ToBase64(),
@@ -683,7 +683,7 @@ namespace BTCPayServer.Controllers
[HttpPost] [HttpPost]
[Route("{walletId}/vault")] [Route("{walletId}/vault")]
public async Task<IActionResult> SubmitVault([ModelBinder(typeof(WalletIdModelBinder))] public async Task<IActionResult> WalletSendVault([ModelBinder(typeof(WalletIdModelBinder))]
WalletId walletId, WalletSendVaultModel model) WalletId walletId, WalletSendVaultModel model)
{ {
var network = NetworkProvider.GetNetwork<BTCPayNetwork>(walletId.CryptoCode); var network = NetworkProvider.GetNetwork<BTCPayNetwork>(walletId.CryptoCode);
@@ -691,7 +691,7 @@ namespace BTCPayServer.Controllers
if (newPSBT != null) if (newPSBT != null)
{ {
model.PSBT = newPSBT.ToBase64(); model.PSBT = newPSBT.ToBase64();
return View("WalletSendVault", model); return View(nameof(WalletSendVault), model);
} }
return RedirectToWalletPSBTReady(model.PSBT); return RedirectToWalletPSBTReady(model.PSBT);

View File

@@ -20,7 +20,7 @@
</div> </div>
<div class="row"> <div class="row">
<div id="body" class="col-md-10"> <div id="body" class="col-md-10">
<form id="broadcastForm" asp-action="SubmitVault" asp-route-walletId="@this.Context.GetRouteValue("walletId")" method="post" style="display:none;"> <form id="broadcastForm" asp-action="WalletSendVault" asp-route-walletId="@this.Context.GetRouteValue("walletId")" method="post" style="display:none;">
<input type="hidden" id="WalletId" asp-for="WalletId" /> <input type="hidden" id="WalletId" asp-for="WalletId" />
<input type="hidden" id="PSBT" asp-for="PSBT" value="@Model.PSBT"/> <input type="hidden" id="PSBT" asp-for="PSBT" value="@Model.PSBT"/>
<input type="hidden" asp-for="WebsocketPath" /> <input type="hidden" asp-for="WebsocketPath" />