diff --git a/packages/api-client/package.json b/packages/api-client/package.json index 36edd9a6..056fba24 100644 --- a/packages/api-client/package.json +++ b/packages/api-client/package.json @@ -15,7 +15,7 @@ }, "dependencies": { "@spree/axios-fetcher": "^1.0.0", - "@spree/storefront-api-v2-sdk": "6.0.2", + "@spree/storefront-api-v2-sdk": "6.0.3", "@vue-storefront/core": "^2.5.0" }, "files": [ diff --git a/packages/api-client/src/api/getCategory/index.ts b/packages/api-client/src/api/getCategory/index.ts index a253ac52..f5cd4133 100644 --- a/packages/api-client/src/api/getCategory/index.ts +++ b/packages/api-client/src/api/getCategory/index.ts @@ -4,8 +4,13 @@ import { deserializeCategories } from '../serializers/category'; const findCategory = (categories: Category[], slug: string) => categories.find(e => e.slug === slug); -export default async function getCategory({ client }: ApiContext, { categorySlug }: GetCategoryParams): Promise { - const result = await client.taxons.list({ fields: { taxon: 'name,permalink,children,parent,is_root' }, per_page: 500 }); +export default async function getCategory({ client, config }: ApiContext, { categorySlug }: GetCategoryParams): Promise { + const locale = await config.internationalization.getLocale(); + const result = await client.taxons.list({ + fields: { taxon: 'name,permalink,children,parent,is_root' }, + per_page: 500, + locale + }); if (result.isSuccess()) { try { diff --git a/packages/api-client/src/api/getProduct/index.ts b/packages/api-client/src/api/getProduct/index.ts index 0442f9ad..e3a1c508 100644 --- a/packages/api-client/src/api/getProduct/index.ts +++ b/packages/api-client/src/api/getProduct/index.ts @@ -4,6 +4,7 @@ import { addHostToProductImages, deserializeSingleProductVariants } from '../ser export default async function getProduct({ client, config }: ApiContext, { slug }: GetProductParams): Promise { const currency = await config.internationalization.getCurrency(); + const locale = await config.internationalization.getLocale(); let include; @@ -21,7 +22,8 @@ export default async function getProduct({ client, config }: ApiContext, { slug variant: 'sku,price,display_price,in_stock,product,images,option_values,is_master' }, include, - currency + currency, + locale } ); diff --git a/yarn.lock b/yarn.lock index dd40f320..fb9094fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3133,10 +3133,10 @@ resolved "https://registry.yarnpkg.com/@spree/axios-fetcher/-/axios-fetcher-1.0.0.tgz#d990ed38ee8bc33706f196a797f90117f8bd4d6d" integrity sha512-mflTBxdhiYAlVvHqZnzsDOs2w4e3CDIUTa4SvK6X9jZy7VhWhPocS9u8Zo8nsLm77kus2oeq3jcZljbEJEbEhw== -"@spree/storefront-api-v2-sdk@6.0.2": - version "6.0.2" - resolved "https://registry.yarnpkg.com/@spree/storefront-api-v2-sdk/-/storefront-api-v2-sdk-6.0.2.tgz#67470a750a26f5c8cddf5b78be90d483aa06832f" - integrity sha512-zcMGuyyqaotGWE4ymkRNFrTddzSjbJ29yvTkeUxpunYFf1ZfwwxWJvGXC7TbdIwIBmIBGMdTxb/wWCh8qUmzRw== +"@spree/storefront-api-v2-sdk@6.0.3": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@spree/storefront-api-v2-sdk/-/storefront-api-v2-sdk-6.0.3.tgz#b04886216258fe6565ca0af3fb84b6e7818d6c44" + integrity sha512-C2aoaGzQqJRBFxipxecDOk3Sy6auzJsVsqVgJuUJyfkf6vtb78U3sqJPZ80S8XrlnCaw2M6an+Hm5uDW1byzqA== "@storefront-ui/shared@0.11.0": version "0.11.0"