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
@@ -25,6 +25,7 @@ const accountPageShortcuts = z.object({
uid: z.string(),
locale: z.nativeEnum(Lang),
}),
original_url: z.string().optional(),
url: z.string(),
title: z.string(),
}),
@@ -55,6 +56,7 @@ const accountPageDynamicContent = z.object({
locale: z.nativeEnum(Lang),
}),
url: z.string(),
original_url: z.string().optional(),
title: z.string(),
}),
})
@@ -86,6 +88,17 @@ type DynamicContentRaw = z.infer<typeof accountPageDynamicContent>
type ShortcutsRaw = z.infer<typeof accountPageShortcuts>
export type Shortcuts = Omit<ShortcutsRaw, "shortcuts"> & {
shortcuts: Omit<ShortcutsRaw["shortcuts"], "shortcuts"> & {
shortcuts: {
text?: string
openInNewTab: boolean
url: string
title: string
}[]
}
}
export type RteTextContent = Omit<TextContentRaw, "text_content"> & {
text_content: {
content: {
@@ -97,7 +110,7 @@ export type RteTextContent = Omit<TextContentRaw, "text_content"> & {
export type AccountPageContentItem =
| DynamicContentRaw
| ShortcutsRaw
| Shortcuts
| RteTextContent
const accountPageContentItem = z.discriminatedUnion("__typename", [