diff --git a/BTCPayServer/Controllers/AppsPublicController.cs b/BTCPayServer/Controllers/AppsPublicController.cs index 1a19b7939..2366c00f0 100644 --- a/BTCPayServer/Controllers/AppsPublicController.cs +++ b/BTCPayServer/Controllers/AppsPublicController.cs @@ -41,12 +41,13 @@ namespace BTCPayServer.Controllers [HttpGet("/apps/{appId}")] public async Task 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}); } diff --git a/BTCPayServer/Services/Apps/AppService.cs b/BTCPayServer/Services/Apps/AppService.cs index 400a334d2..b6ef4f21b 100644 --- a/BTCPayServer/Services/Apps/AppService.cs +++ b/BTCPayServer/Services/Apps/AppService.cs @@ -248,13 +248,13 @@ namespace BTCPayServer.Services.Apps } } - public async Task GetApp(string appId, AppType appType, bool includeStore = false) + public async Task 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) {