@reactionary/commercetools 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
success,
|
|
20
20
|
error
|
|
21
21
|
} from "@reactionary/core";
|
|
22
|
+
import { getLanguageCodeFromLocale } from "../core/locale-utils.js";
|
|
22
23
|
class CommercetoolsProductCapability extends ProductCapability {
|
|
23
24
|
constructor(cache, context, config, commercetools, factory) {
|
|
24
25
|
super(cache, context);
|
|
@@ -38,10 +39,10 @@ class CommercetoolsProductCapability extends ProductCapability {
|
|
|
38
39
|
}
|
|
39
40
|
async getBySlug(payload) {
|
|
40
41
|
const client = await this.getClient();
|
|
42
|
+
const localeStr = getLanguageCodeFromLocale(this.context.languageContext.locale) || "en";
|
|
41
43
|
const remote = await client.get({
|
|
42
44
|
queryArgs: {
|
|
43
|
-
|
|
44
|
-
where: "slug(en = :slug)",
|
|
45
|
+
where: `slug(${localeStr} = :slug)`,
|
|
45
46
|
"var.slug": payload.slug
|
|
46
47
|
}
|
|
47
48
|
}).execute();
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/commercetools",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"vitest": "^4.0.9",
|
|
9
9
|
"@nx/vite": "22.4.5",
|
|
10
|
-
"@reactionary/core": "0.9.
|
|
10
|
+
"@reactionary/core": "0.9.4",
|
|
11
11
|
"zod": "4.1.9",
|
|
12
12
|
"@commercetools/ts-client": "^4.9.1",
|
|
13
13
|
"@commercetools/platform-sdk": "^8.25.0",
|