mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-02-14 02:34:25 +01:00
Small nits
This commit is contained in:
@@ -19,11 +19,6 @@ namespace BTCPayServer.Controllers
|
||||
{
|
||||
public partial class UIStoresController
|
||||
{
|
||||
private void setupBitcoinWalletTransactions()
|
||||
{
|
||||
ViewData["BitcoinWalletTransactions"] = _callbackGenerator.WalletTransactionsLink(HttpContext.GetStoreData().Id, "BTC", Request);
|
||||
}
|
||||
|
||||
[HttpGet("{storeId}/emails/rules")]
|
||||
public async Task<IActionResult> StoreEmailRulesList(string storeId)
|
||||
{
|
||||
@@ -49,7 +44,6 @@ namespace BTCPayServer.Controllers
|
||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||
public IActionResult StoreEmailRulesCreate(string storeId)
|
||||
{
|
||||
setupBitcoinWalletTransactions();
|
||||
return View("StoreEmailRulesManage", new StoreEmailRule());
|
||||
}
|
||||
|
||||
@@ -57,8 +51,6 @@ namespace BTCPayServer.Controllers
|
||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||
public async Task<IActionResult> StoreEmailRulesCreate(string storeId, StoreEmailRule model)
|
||||
{
|
||||
setupBitcoinWalletTransactions();
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return View("StoreEmailRulesManage", model);
|
||||
|
||||
@@ -93,8 +85,6 @@ namespace BTCPayServer.Controllers
|
||||
var rules = store.GetStoreBlob().EmailRules;
|
||||
if (rules == null || ruleIndex >= rules.Count) return NotFound();
|
||||
|
||||
setupBitcoinWalletTransactions();
|
||||
|
||||
var rule = rules[ruleIndex];
|
||||
return View("StoreEmailRulesManage", rule);
|
||||
}
|
||||
@@ -103,7 +93,6 @@ namespace BTCPayServer.Controllers
|
||||
[Authorize(Policy = Policies.CanModifyStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Cookie)]
|
||||
public async Task<IActionResult> StoreEmailRulesEdit(string storeId, int ruleIndex, StoreEmailRule model)
|
||||
{
|
||||
setupBitcoinWalletTransactions();
|
||||
if (!ModelState.IsValid)
|
||||
return View("StoreEmailRulesManage", model);
|
||||
|
||||
|
||||
@@ -81,13 +81,12 @@ namespace BTCPayServer.Services
|
||||
|
||||
private Exception Bug([CallerMemberName] string? name = null) => new InvalidOperationException($"Error generating link for {name} (Report this bug to BTCPay Server github repository)");
|
||||
|
||||
public string WalletTransactionsLink(string storeId, string cryptoCode, HttpRequest request)
|
||||
public string WalletTransactionsLink(WalletId walletId, HttpRequest request)
|
||||
{
|
||||
var walletId = new WalletId(storeId, cryptoCode);
|
||||
return LinkGenerator.GetUriByAction(
|
||||
action: nameof(UIWalletsController.WalletTransactions),
|
||||
controller: "UIWallets",
|
||||
values: new { walletId },
|
||||
values: new { walletId = walletId.ToString() },
|
||||
scheme: request.Scheme,
|
||||
host: request.Host,
|
||||
pathBase: request.PathBase
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
@using BTCPayServer.HostedServices.Webhooks
|
||||
@using BTCPayServer.Services
|
||||
@using Microsoft.AspNetCore.Mvc.TagHelpers
|
||||
@model BTCPayServer.Controllers.UIStoresController.StoreEmailRule
|
||||
@inject WebhookSender WebhookSender
|
||||
@inject CallbackGenerator CallbackGenerator
|
||||
|
||||
@{
|
||||
var storeId = Context.GetStoreData().Id;
|
||||
bool isEdit = Model.Trigger != null;
|
||||
ViewData.SetActivePage(StoreNavPages.Emails, StringLocalizer[isEdit ? "Edit Email Rule" : "Create Email Rule"], storeId);
|
||||
var bitcoinWalletTransactions = ViewData["BitcoinWalletTransactions"]?.ToString() ?? "";
|
||||
var bitcoinWalletTransactions = CallbackGenerator.WalletTransactionsLink(new (storeId, "BTC"), this.Context.Request);
|
||||
}
|
||||
|
||||
@section PageHeadContent {
|
||||
|
||||
Reference in New Issue
Block a user