Compare commits

...

1 Commits

Author SHA1 Message Date
f31fc9ea37 Fix link from app label 2020-10-29 08:15:13 +01:00
2 changed files with 6 additions and 5 deletions
BTCPayServer
Controllers
Services/Apps

@ -41,12 +41,13 @@ namespace BTCPayServer.Controllers
[HttpGet("/apps/{appId}")]
public async Task<IActionResult> RedirectToApp(string appId)
{
switch (await _AppService.GetAppInfo(appId))
switch ((await _AppService.GetApp(appId, null)).AppType)
{
case ViewCrowdfundViewModel _:
case nameof(AppType.Crowdfund):
return RedirectToAction("ViewCrowdfund", new {appId});
case ViewPointOfSaleViewModel _:
case nameof(AppType.PointOfSale):
return RedirectToAction("ViewPointOfSale", new {appId});
}

@ -248,13 +248,13 @@ namespace BTCPayServer.Services.Apps
}
}
public async Task<AppData> GetApp(string appId, AppType appType, bool includeStore = false)
public async Task<AppData> GetApp(string appId, AppType? appType, bool includeStore = false)
{
using (var ctx = _ContextFactory.CreateContext())
{
var query = ctx.Apps
.Where(us => us.Id == appId &&
us.AppType == appType.ToString());
(appType == null || us.AppType == appType.ToString()));
if (includeStore)
{