mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Added the logic for sorting stores on API creation
This commit is contained in:
committed by
rockstardev
parent
21d609aab0
commit
89cd1e507b
@@ -466,7 +466,10 @@ namespace BTCPayServer.Controllers
|
||||
|
||||
private async Task<T> SetViewModelValues<T>(T viewModel) where T : AddApiKeyViewModel
|
||||
{
|
||||
viewModel.Stores = await _StoreRepository.GetStoresByUserId(_userManager.GetUserId(User));
|
||||
// FIXED: Added OrderBy to sort stores alphabetically by name
|
||||
var stores = await _StoreRepository.GetStoresByUserId(_userManager.GetUserId(User));
|
||||
viewModel.Stores = stores.OrderBy(store => store.StoreName).ToArray();
|
||||
//viewModel.Stores = await _StoreRepository.GetStoresByUserId(_userManager.GetUserId(User));
|
||||
var isAdmin = (await _authorizationService.AuthorizeAsync(User, Policies.CanModifyServerSettings))
|
||||
.Succeeded;
|
||||
viewModel.PermissionValues ??= Policies.AllPolicies
|
||||
|
||||
Reference in New Issue
Block a user