Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Keep `country_isos` readable on markets with a deprecation (#14682)

Damian Legawiec2a419d42e86d
diff --git a/packages/admin-sdk/src/types/generated/Market.ts b/packages/admin-sdk/src/types/generated/Market.ts
index a0aa544fc2..a76a0d87e4 100644
--- a/packages/admin-sdk/src/types/generated/Market.ts
+++ b/packages/admin-sdk/src/types/generated/Market.ts
@@ -1,4 +1,4 @@
-// Typelizer digest 095833704b32302f3cdf81ad852ac4a0
+// Typelizer digest 9b55296dcd95f7ee0d362da53fa16bbb
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {Country} from '@/types'
@@ -11,6 +11,7 @@ interface Market {
tax_inclusive: boolean;
default: boolean;
country_codes: Array<string>;
+ country_isos: Array<string>;
supported_locales: Array<string>;
countries?: Array<Country>;
tax_provider: string | null;
diff --git a/packages/sdk/src/types/generated/Market.ts b/packages/sdk/src/types/generated/Market.ts
index 230ea1f1d3..17281ed1a0 100644
--- a/packages/sdk/src/types/generated/Market.ts
+++ b/packages/sdk/src/types/generated/Market.ts
@@ -1,4 +1,4 @@
-// Typelizer digest ae2dab21fb8c33f769d36001241124d3
+// Typelizer digest 7178b6d1156dd064a11a5faab0008fa0
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {Country} from '@/types'
@@ -11,6 +11,7 @@ interface Market {
tax_inclusive: boolean;
default: boolean;
country_codes: Array<string>;
+ country_isos: Array<string>;
supported_locales: Array<string>;
countries?: Array<Country>;
}
diff --git a/packages/sdk/src/zod/generated/Market.ts b/packages/sdk/src/zod/generated/Market.ts
index 587d0488ad..4d41c19ba3 100644
--- a/packages/sdk/src/zod/generated/Market.ts
+++ b/packages/sdk/src/zod/generated/Market.ts
@@ -10,6 +10,7 @@ export const MarketSchema: z.ZodObject<any> = z.object({
tax_inclusive: z.boolean(),
default: z.boolean(),
country_codes: z.array(z.string()),
+ country_isos: z.array(z.string()),
supported_locales: z.array(z.string()),
countries: z.array(z.lazy(() => CountrySchema)).optional(),
});
diff --git a/spree/api/app/serializers/spree/api/v3/market_serializer.rb b/spree/api/app/serializers/spree/api/v3/market_serializer.rb
index cbea5ef423..6df3b4382a 100644
--- a/spree/api/app/serializers/spree/api/v3/market_serializer.rb
+++ b/spree/api/app/serializers/spree/api/v3/market_serializer.rb
@@ -6,11 +6,16 @@ module Spree
default_locale: :string,
supported_locales: [:string, multi: true],
country_codes: [:string, multi: true],
+ country_isos: [:string, multi: true],
tax_inclusive: :boolean,
default: :boolean
attributes :name, :currency, :default_locale, :tax_inclusive, :default, :country_codes
+ # @deprecated Storefronts shipped against this name; use +country_codes+.
+ # Removed in 6.1.
+ attribute :country_isos, &:country_codes
+
attribute :supported_locales do |market|
market.supported_locales_list
end