@akinon/next 1.60.0-rc.8 → 1.60.0-rc.9

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.60.0-rc.9
4
+
5
+ ### Minor Changes
6
+
7
+ - ad5de2c: ZERO-2949: Add currency and language headers to format=json request
8
+
3
9
  ## 1.60.0-rc.8
4
10
 
5
11
  ### Minor Changes
@@ -37,6 +37,12 @@ const withPzDefault =
37
37
  // Support legacy ?format=json query param
38
38
  if (searchParams.has('json') || searchParams.get('format') === 'json') {
39
39
  try {
40
+ const { locales } = Settings.localization;
41
+ const locale = req.cookies.get('pz-locale')?.value;
42
+ const selectedLanguageValue = locales.find(
43
+ (l) => l.value === locale
44
+ )?.apiValue;
45
+
40
46
  searchParams.set('format', 'json');
41
47
 
42
48
  const request = await fetch(
@@ -51,7 +57,9 @@ const withPzDefault =
51
57
  headers: {
52
58
  Cookie: req.headers.get('cookie') || '',
53
59
  Accept: 'application/json',
54
- 'X-Requested-With': 'XMLHttpRequest'
60
+ 'X-Requested-With': 'XMLHttpRequest',
61
+ 'x-currency': req.cookies.get('pz-currency')?.value ?? '',
62
+ 'Accept-Language': selectedLanguageValue ?? ''
55
63
  }
56
64
  }
57
65
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@akinon/next",
3
3
  "description": "Core package for Project Zero Next",
4
- "version": "1.60.0-rc.8",
4
+ "version": "1.60.0-rc.9",
5
5
  "private": false,
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "set-cookie-parser": "2.6.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@akinon/eslint-plugin-projectzero": "1.60.0-rc.8",
33
+ "@akinon/eslint-plugin-projectzero": "1.60.0-rc.9",
34
34
  "@types/react-redux": "7.1.30",
35
35
  "@types/set-cookie-parser": "2.4.7",
36
36
  "@typescript-eslint/eslint-plugin": "6.7.4",