From 652b958d4f20287da969d693687dd35a46e0fd3c Mon Sep 17 00:00:00 2001 From: rockstardev Date: Fri, 24 Jan 2020 15:11:34 -0600 Subject: [PATCH] Removing viewapp command now that we directly redirect in cshtml --- .../Controllers/AppsController.Crowdfund.cs | 26 ++++++------------- .../Views/Apps/UpdateCrowdfund.cshtml | 2 +- .../Views/Apps/UpdatePointOfSale.cshtml | 2 +- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/BTCPayServer/Controllers/AppsController.Crowdfund.cs b/BTCPayServer/Controllers/AppsController.Crowdfund.cs index 503e37c91..98d40b0a6 100644 --- a/BTCPayServer/Controllers/AppsController.Crowdfund.cs +++ b/BTCPayServer/Controllers/AppsController.Crowdfund.cs @@ -157,26 +157,16 @@ namespace BTCPayServer.Controllers app.TagAllInvoices = vm.UseAllStoreInvoices; app.SetSettings(newSettings); - if (command == "save") - { - await _AppService.UpdateOrCreateApp(app); + await _AppService.UpdateOrCreateApp(app); - _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") + _EventAggregator.Publish(new AppUpdated() { - return RedirectToAction(nameof(AppsPublicController.ViewCrowdfund), "AppsPublic", new { appId }); - } - return NotFound(); + AppId = appId, + StoreId = app.StoreDataId, + Settings = newSettings + }); + TempData[WellKnownTempData.SuccessMessage] = "App updated"; + return RedirectToAction(nameof(UpdateCrowdfund), new { appId }); } } } diff --git a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml index b9ed7b0ec..12a5091af 100644 --- a/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml +++ b/BTCPayServer/Views/Apps/UpdateCrowdfund.cshtml @@ -215,7 +215,7 @@
- +