Skip to content

Commit

Permalink
fix: empty response from regions graphql (#878)
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc authored Feb 24, 2022
1 parent b1e9522 commit 1ad0520
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/content-api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ async function getRenderedRegionsByPageType({ accessToken, storeUrl, pageType })
}),
});

if (!response.data.data) {
return { renderedRegions: [] };
}
const {
site: {
content: {
Expand Down Expand Up @@ -75,6 +78,9 @@ async function getRenderedRegionsByPageTypeAndEntityId({
}),
});

if (!response.data.data) {
return { renderedRegions: [] };
}
const {
site: {
content: {
Expand Down

0 comments on commit 1ad0520

Please sign in to comment.