@pronto-tools-and-more/api 14.3.0 → 14.4.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/api",
3
- "version": "14.3.0",
3
+ "version": "14.4.0",
4
4
  "description": "",
5
5
  "main": "src/main.js",
6
6
  "type": "module",
@@ -21,10 +21,17 @@ export const handleMenus = async ({ appId, apiUrl, req }) => {
21
21
  variables: realBottom,
22
22
  }),
23
23
  });
24
+
24
25
  const result = await response.json();
26
+
27
+ // @ts-ignore
28
+ if (result && result.error) {
29
+ // @ts-ignore
30
+ throw new Error(`api error: ${result.error}`);
31
+ }
25
32
  // @ts-ignore
26
33
  const realData = result.data.catalog.menusConnection.edges
27
- .map((edge) => edge.content)
34
+ .map((edge) => edge.node)
28
35
  .map((node) => {
29
36
  const { __typename, ...rest } = node;
30
37
  return rest;