@akinon/next 1.42.0-rc.2 → 1.42.0-rc.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @akinon/next
2
2
 
3
+ ## 1.42.0-rc.4
4
+
5
+ ### Minor Changes
6
+
7
+ - 46b7aad: ZERO-2775: Add condition and logger for menuitemmodel data
8
+
9
+ ## 1.42.0-rc.3
10
+
11
+ ### Minor Changes
12
+
13
+ - fda5b92: ZERO-2725: fix invalid import
14
+
3
15
  ## 1.42.0-rc.2
4
16
 
5
17
  ## 1.42.0-rc.1
@@ -5,7 +5,7 @@ import { getCurrency } from '@akinon/next/utils';
5
5
 
6
6
  import { useLocalization } from '@akinon/next/hooks';
7
7
  import { PriceProps } from '../types';
8
- import Settings from '@theme/settings';
8
+ import Settings from 'settings';
9
9
 
10
10
  export const Price = (props: NumericFormatProps & PriceProps) => {
11
11
  const {
@@ -1,11 +1,8 @@
1
1
  import { Cache, CacheKey } from '../../lib/cache';
2
2
  import { product } from '../urls';
3
- import {
4
- BreadcrumbResultType,
5
- ProductCategoryResult,
6
- ProductResult
7
- } from '../../types';
3
+ import { ProductCategoryResult, ProductResult } from '../../types';
8
4
  import appFetch from '../../utils/app-fetch';
5
+ import logger from '../../utils/log';
9
6
 
10
7
  type GetProduct = {
11
8
  pk: number;
@@ -50,9 +47,17 @@ const getProductDataHandler = ({
50
47
  }
51
48
  );
52
49
 
53
- const breadcrumbUrl = product.breadcrumbUrl(
54
- productCategoryData.results[0].menuitemmodel
55
- );
50
+ const menuItemModel = productCategoryData?.results[0]?.menuitemmodel;
51
+
52
+ if (!menuItemModel) {
53
+ logger.warn('menuItemModel is undefined, skipping breadcrumbData fetch', {
54
+ handler: 'getProductDataHandler',
55
+ pk
56
+ });
57
+ return { data, breadcrumbData: undefined };
58
+ }
59
+
60
+ const breadcrumbUrl = product.breadcrumbUrl(menuItemModel);
56
61
 
57
62
  const breadcrumbData = await appFetch<any>(breadcrumbUrl, {
58
63
  headers: {
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.42.0-rc.2",
4
+ "version": "1.42.0-rc.4",
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.42.0-rc.2",
33
+ "@akinon/eslint-plugin-projectzero": "1.42.0-rc.4",
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",