mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-03 17:36:59 +01:00
parent
f776725096
commit
52fe374aaa
1 changed files with 9 additions and 5 deletions
|
@ -82,9 +82,7 @@ namespace BTCPayServer.Controllers
|
||||||
var store = await _storeRepository.FindStore(storeId, userId);
|
var store = await _storeRepository.FindStore(storeId, userId);
|
||||||
if (store != null)
|
if (store != null)
|
||||||
{
|
{
|
||||||
return store.Role == StoreRoles.Owner
|
return RedirectToStore(store);
|
||||||
? RedirectToAction("Dashboard", "UIStores", new { storeId })
|
|
||||||
: RedirectToAction("ListInvoices", "UIInvoice", new { storeId });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,8 +90,7 @@ namespace BTCPayServer.Controllers
|
||||||
if (stores.Any())
|
if (stores.Any())
|
||||||
{
|
{
|
||||||
// redirect to first store
|
// redirect to first store
|
||||||
storeId = stores.First().Id;
|
return RedirectToStore(stores.First());
|
||||||
return RedirectToAction("Dashboard", "UIStores", new { storeId });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var vm = new HomeViewModel
|
var vm = new HomeViewModel
|
||||||
|
@ -169,5 +166,12 @@ namespace BTCPayServer.Controllers
|
||||||
{
|
{
|
||||||
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RedirectToActionResult RedirectToStore(StoreData store)
|
||||||
|
{
|
||||||
|
return store.Role == StoreRoles.Owner
|
||||||
|
? RedirectToAction("Dashboard", "UIStores", new { storeId = store.Id })
|
||||||
|
: RedirectToAction("ListInvoices", "UIInvoice", new { storeId = store.Id });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue