When creating PoS app, redirect to settings. When updating an app, redirect to List of apps.

This commit is contained in:
nicolas.dorier
2018-07-05 21:11:18 +09:00
parent 7210eebeca
commit 5af14ef2ec
2 changed files with 5 additions and 2 deletions

View File

@@ -134,7 +134,7 @@ namespace BTCPayServer.Controllers
}); });
await UpdateAppSettings(app); await UpdateAppSettings(app);
StatusMessage = "App updated"; StatusMessage = "App updated";
return RedirectToAction(nameof(UpdatePointOfSale)); return RedirectToAction(nameof(ListApps));
} }
[HttpGet] [HttpGet]

View File

@@ -102,9 +102,9 @@ namespace BTCPayServer.Controllers
StatusMessage = "Error: You are not owner of this store"; StatusMessage = "Error: You are not owner of this store";
return RedirectToAction(nameof(ListApps)); return RedirectToAction(nameof(ListApps));
} }
var id = Encoders.Base58.EncodeData(RandomUtils.GetBytes(32));
using (var ctx = _ContextFactory.CreateContext()) using (var ctx = _ContextFactory.CreateContext())
{ {
var id = Encoders.Base58.EncodeData(RandomUtils.GetBytes(32));
var appData = new AppData() { Id = id }; var appData = new AppData() { Id = id };
appData.StoreDataId = selectedStore; appData.StoreDataId = selectedStore;
appData.Name = vm.Name; appData.Name = vm.Name;
@@ -113,6 +113,9 @@ namespace BTCPayServer.Controllers
await ctx.SaveChangesAsync(); await ctx.SaveChangesAsync();
} }
StatusMessage = "App successfully created"; StatusMessage = "App successfully created";
if (appType == AppType.PointOfSale)
return RedirectToAction(nameof(UpdatePointOfSale), new { appId = id });
return RedirectToAction(nameof(ListApps)); return RedirectToAction(nameof(ListApps));
} }