Skip to content

Commit

Permalink
fix: when there's no regions on the page
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc committed Feb 24, 2022
1 parent 08be707 commit a94f205
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 a94f205

Please sign in to comment.