fix: correct acount page linking

This commit is contained in:
Arvid Norlin
2024-05-06 12:44:32 +02:00
parent 2a46fe6572
commit 16634abbbf
4 changed files with 35 additions and 13 deletions

View File

@@ -36,8 +36,22 @@ export const accountPageQueryRouter = router({
(block) => {
switch (block.__typename) {
case ContentEntries.AccountPageContentDynamicContent:
case ContentEntries.AccountPageContentShortcuts:
return block
case ContentEntries.AccountPageContentShortcuts:
return {
...block,
shortcuts: {
...block.shortcuts,
shortcuts: block.shortcuts.shortcuts.map((shortcut) => ({
text: shortcut.text,
openInNewTab: shortcut.open_in_new_tab,
...shortcut.linkConnection.edges[0].node,
url:
shortcut.linkConnection.edges[0].node.original_url ||
`/${shortcut.linkConnection.edges[0].node.system.locale}${shortcut.linkConnection.edges[0].node.url}`,
})),
},
}
case ContentEntries.AccountPageContentTextContent:
return {
...block,