From 75835666234ca095771e9b6bf625704ad90b93d2 Mon Sep 17 00:00:00 2001 From: RiabushenkoA Date: Thu, 14 Aug 2025 17:16:00 +0300 Subject: [PATCH] Fixes in action 'List online store pages' --- Apps.Shopify/Actions/OnlineStorePageActions.cs | 2 +- Apps.Shopify/Apps.Shopify.csproj | 2 +- .../DataSourceHandlers/OnlineStorePageHandler.cs | 2 +- Apps.Shopify/TranslatableResource.cs | 3 ++- Tests.Shopify/StoreTests.cs | 14 ++++++++++++++ 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Apps.Shopify/Actions/OnlineStorePageActions.cs b/Apps.Shopify/Actions/OnlineStorePageActions.cs index 8d20383..03bdb8b 100644 --- a/Apps.Shopify/Actions/OnlineStorePageActions.cs +++ b/Apps.Shopify/Actions/OnlineStorePageActions.cs @@ -29,7 +29,7 @@ public async Task ListPages() { var variables = new Dictionary() { - ["resourceType"] = TranslatableResource.ONLINE_STORE_PAGE + ["resourceType"] = TranslatableResource.PAGE }; var response = await Client .Paginate( diff --git a/Apps.Shopify/Apps.Shopify.csproj b/Apps.Shopify/Apps.Shopify.csproj index 26a9ea9..253f8c2 100644 --- a/Apps.Shopify/Apps.Shopify.csproj +++ b/Apps.Shopify/Apps.Shopify.csproj @@ -6,7 +6,7 @@ enable Shopify E-commerce platform that enables individuals and businesses to create and manage online stores. - 1.5.6 + 1.5.7 Apps.Shopify diff --git a/Apps.Shopify/DataSourceHandlers/OnlineStorePageHandler.cs b/Apps.Shopify/DataSourceHandlers/OnlineStorePageHandler.cs index 7ad4e38..0b27867 100644 --- a/Apps.Shopify/DataSourceHandlers/OnlineStorePageHandler.cs +++ b/Apps.Shopify/DataSourceHandlers/OnlineStorePageHandler.cs @@ -5,7 +5,7 @@ namespace Apps.Shopify.DataSourceHandlers; public class OnlineStorePageHandler : TranslatableResourceHandler { - protected override TranslatableResource ResourceType => TranslatableResource.ONLINE_STORE_PAGE; + protected override TranslatableResource ResourceType => TranslatableResource.PAGE; public OnlineStorePageHandler(InvocationContext invocationContext) : base(invocationContext) { diff --git a/Apps.Shopify/TranslatableResource.cs b/Apps.Shopify/TranslatableResource.cs index 992fa5c..a2d7440 100644 --- a/Apps.Shopify/TranslatableResource.cs +++ b/Apps.Shopify/TranslatableResource.cs @@ -13,7 +13,8 @@ public enum TranslatableResource ONLINE_STORE_ARTICLE, ONLINE_STORE_BLOG, ONLINE_STORE_MENU, - ONLINE_STORE_PAGE, + //ONLINE_STORE_PAGE, //does not exist in shopify enum + PAGE, ONLINE_STORE_THEME, ONLINE_STORE_THEME_APP_EMBED, ONLINE_STORE_THEME_JSON_TEMPLATE, diff --git a/Tests.Shopify/StoreTests.cs b/Tests.Shopify/StoreTests.cs index bd5afd8..c194e7e 100644 --- a/Tests.Shopify/StoreTests.cs +++ b/Tests.Shopify/StoreTests.cs @@ -18,5 +18,19 @@ public async Task GetStoreContent_ReturnsValues() var result = await action.GetStoreContent(input1,input2,input3); Assert.IsNotNull(result); } + + [TestMethod] + public async Task ListPages_ReturnsValues() + { + var action = new OnlineStorePageActions(InvocationContext, FileManager); + var input1 = new StoreContentRequest { IncludeShop = true }; + var input2 = new LocaleRequest { Locale = "fr" }; + var input3 = new GetContentRequest { }; + var result = await action.ListPages(); + + var json = Newtonsoft.Json.JsonConvert.SerializeObject(result); + Console.WriteLine(json); + Assert.IsNotNull(result); + } } }