mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 09:54:30 +01:00
Fix link from app label (#2028)
This commit is contained in:
parent
793b1b56d9
commit
d2910686cd
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user