Merged in fix/book-639-startpage-cache (pull request #3288)
feat(BOOK-639): add all block types on startpage to refs cache key * feat(BOOK-639): add all block types on startpage to refs cache key Approved-by: Erik Tiekstra Approved-by: Matilda Landström
This commit is contained in:
@@ -21,7 +21,8 @@ export function getConnections({ start_page }: StartPageRefs) {
|
||||
|
||||
if (start_page.blocks) {
|
||||
start_page.blocks.forEach((block) => {
|
||||
switch (block.__typename) {
|
||||
const typeName = block.__typename
|
||||
switch (typeName) {
|
||||
case StartPageEnum.ContentStack.blocks.FullWidthCampaign: {
|
||||
block.full_width_campaign.full_width_campaignConnection.edges.forEach(
|
||||
({ node }) => {
|
||||
@@ -32,6 +33,30 @@ export function getConnections({ start_page }: StartPageRefs) {
|
||||
)
|
||||
break
|
||||
}
|
||||
case StartPageEnum.ContentStack.blocks.CardsGrid: {
|
||||
block.cards_grid.forEach((card) => {
|
||||
connections.push(card)
|
||||
})
|
||||
break
|
||||
}
|
||||
case StartPageEnum.ContentStack.blocks.CarouselCards: {
|
||||
block.carousel_cards.card_groups.forEach((group) => {
|
||||
group.cardConnection.edges.forEach((node) => {
|
||||
connections.push(node.node.system)
|
||||
})
|
||||
})
|
||||
break
|
||||
}
|
||||
case StartPageEnum.ContentStack.blocks.JoinScandicFriends: {
|
||||
if (block.join_scandic_friends.primary_button) {
|
||||
connections.push(block.join_scandic_friends.primary_button)
|
||||
}
|
||||
break
|
||||
}
|
||||
default: {
|
||||
const _exhaustiveCheck: never = typeName
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user