@shopbite-de/storefront 1.2.6 → 1.2.7

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.
@@ -9,7 +9,7 @@ const { resolvePath } = useNavigationSearch();
9
9
  const route = useRoute();
10
10
  const routePath = route.path;
11
11
 
12
- const { data: seoResult } = await useAsyncData(
12
+ const { data: seoResult, error } = await useAsyncData(
13
13
  `cmsResponse${routePath}`,
14
14
  async () => {
15
15
  // For client links if the history state contains seo url information we can omit the api call
@@ -22,17 +22,20 @@ const { data: seoResult } = await useAsyncData(
22
22
  }
23
23
  }
24
24
  const seoUrl = await resolvePath(routePath);
25
+
26
+ if (!seoUrl?.foreignKey) {
27
+ throw createError({
28
+ statusCode: 404,
29
+ statusMessage: `No data fetched from API for ${routePath}`,
30
+ });
31
+ }
32
+
25
33
  return seoUrl;
26
34
  },
27
35
  );
28
36
 
29
- if (!seoResult.value?.foreignKey) {
30
- console.error("c/[...all].vue:", `No data found in API for ${routePath}`);
31
-
32
- throw createError({
33
- statusCode: 404,
34
- statusMessage: `No data fetched from API for ${routePath}`,
35
- });
37
+ if (error.value) {
38
+ throw error.value;
36
39
  }
37
40
 
38
41
  const { foreignKey } = useNavigationContext(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopbite-de/storefront",
3
- "version": "1.2.6",
3
+ "version": "1.2.7",
4
4
  "main": "nuxt.config.ts",
5
5
  "description": "Shopware storefront for food delivery shops",
6
6
  "keywords": [