Removing viewapp command now that we directly redirect in cshtml

This commit is contained in:
rockstardev
2020-01-24 15:11:34 -06:00
parent c7c0db612a
commit 652b958d4f
3 changed files with 10 additions and 20 deletions

View File

@@ -157,26 +157,16 @@ namespace BTCPayServer.Controllers
app.TagAllInvoices = vm.UseAllStoreInvoices; app.TagAllInvoices = vm.UseAllStoreInvoices;
app.SetSettings(newSettings); app.SetSettings(newSettings);
if (command == "save") await _AppService.UpdateOrCreateApp(app);
{
await _AppService.UpdateOrCreateApp(app);
_EventAggregator.Publish(new AppUpdated() _EventAggregator.Publish(new AppUpdated()
{
AppId = appId,
StoreId = app.StoreDataId,
Settings = newSettings
});
TempData[WellKnownTempData.SuccessMessage] = "App updated";
return RedirectToAction(nameof(UpdateCrowdfund), new { appId });
}
// TODO: Check with Kukks if we can remove this tricky logic of redirecting to viewapp
// I've already switched do button directly linking to AppPublic ViewCrowdfund action
else if (command == "viewapp")
{ {
return RedirectToAction(nameof(AppsPublicController.ViewCrowdfund), "AppsPublic", new { appId }); AppId = appId,
} StoreId = app.StoreDataId,
return NotFound(); Settings = newSettings
});
TempData[WellKnownTempData.SuccessMessage] = "App updated";
return RedirectToAction(nameof(UpdateCrowdfund), new { appId });
} }
} }
} }

View File

@@ -215,7 +215,7 @@
</div> </div>
<input type="hidden" asp-for="NotificationEmailWarning" /> <input type="hidden" asp-for="NotificationEmailWarning" />
<div class="form-group"> <div class="form-group">
<button name="command" type="submit" class="btn btn-primary" value="save" id="SaveSettings">Save settings</button> <button type="submit" class="btn btn-primary" id="SaveSettings">Save Settings</button>
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm">Invoices</a> <a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm">Invoices</a>
<a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm" <a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm"

View File

@@ -145,7 +145,7 @@
</div> </div>
<input type="hidden" asp-for="NotificationEmailWarning" /> <input type="hidden" asp-for="NotificationEmailWarning" />
<div class="form-group"> <div class="form-group">
<input type="submit" class="btn btn-primary" value="Save Settings" id="SaveSettings" /> <button type="submit" class="btn btn-primary" id="SaveSettings">Save Settings</button>
<div class="btn-group"> <div class="btn-group">
<a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm">Invoices</a> <a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm">Invoices</a>
<a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm" <a class="btn btn-outline-primary" asp-action="ListInvoices" asp-controller="Invoice" asp-route-searchterm="@Model.SearchTerm"