Fix email rule remove action (#3901)

It simply exited to early by returning the view. The updated rules didn't get saved afterwards.
This commit is contained in:
d11n 2022-06-28 07:10:45 +02:00 committed by GitHub
parent 6d3e1bb40a
commit a4aa6c5ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -48,11 +48,7 @@ namespace BTCPayServer.Controllers
var item = command[(command.IndexOf(":", StringComparison.InvariantCultureIgnoreCase) + 1)..];
var index = int.Parse(item, CultureInfo.InvariantCulture);
vm.Rules.RemoveAt(index);
return View(vm);
}
if (command == "add")
} else if (command == "add")
{
vm.Rules.Add(new StoreEmailRule());

View file

@ -5,7 +5,7 @@
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePage(StoreNavPages.Emails, "Email Rules", Context.GetStoreData().Id);
}
<form class="row" asp-action="StoreEmails" asp-route-storeId="@Context.GetStoreData().Id">
<form class="row" asp-action="StoreEmails" method="post" asp-route-storeId="@Context.GetStoreData().Id">
<div class="col-xxl-constrain">
<div class="d-flex align-items-center justify-content-between mt-n1 mb-3">
<h3 class="mb-0">@ViewData["Title"]</h3>