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);
|
||||
if (store != null)
|
||||
{
|
||||
return store.Role == StoreRoles.Owner
|
||||
? RedirectToAction("Dashboard", "UIStores", new { storeId })
|
||||
: RedirectToAction("ListInvoices", "UIInvoice", new { storeId });
|
||||
return RedirectToStore(store);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,8 +90,7 @@ namespace BTCPayServer.Controllers
|
|||
if (stores.Any())
|
||||
{
|
||||
// redirect to first store
|
||||
storeId = stores.First().Id;
|
||||
return RedirectToAction("Dashboard", "UIStores", new { storeId });
|
||||
return RedirectToStore(stores.First());
|
||||
}
|
||||
|
||||
var vm = new HomeViewModel
|
||||
|
@ -169,5 +166,12 @@ namespace BTCPayServer.Controllers
|
|||
{
|
||||
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