Do not through missing-permission error when no store on /api/v1/stores (Close #4735) (#4748)

This commit is contained in:
Nicolas Dorier
2023-03-08 21:36:51 +09:00
committed by GitHub
parent 7b5ce8f70c
commit 98d62e826b
6 changed files with 20 additions and 12 deletions

View File

@@ -1,3 +1,4 @@
using System.Linq;
using System.Threading.Tasks;
using BTCPayServer.Abstractions.Constants;
using BTCPayServer.Client;
@@ -52,9 +53,9 @@ namespace BTCPayServer.Controllers.Greenfield
[HttpGet("me/stores")]
[Authorize(Policy = Policies.CanViewStoreSettings, AuthenticationSchemes = AuthenticationSchemes.Greenfield)]
public StoreData[] GetCurrentUserStores()
public BTCPayServer.Client.Models.StoreData[] GetCurrentUserStores()
{
return this.HttpContext.GetStoresData();
return this.HttpContext.GetStoresData().Select(Greenfield.GreenfieldStoresController.FromModel).ToArray();
}
[HttpGet("me/stores/{storeId}/can-view")]