feat(WEB-205, WEB-206): get breadcrumbs for my pages from contentstack

This commit is contained in:
Simon Emanuelsson
2024-04-16 12:42:44 +02:00
parent b60f5c3858
commit b2e992c69a
31 changed files with 291 additions and 139 deletions

2
types/auth.d.ts vendored
View File

@@ -15,7 +15,7 @@ declare module "next-auth" {
* The shape of the account object returned in the OAuth providers' `account` callback,
* Usually contains information about the provider being used, like OAuth tokens (`access_token`, etc).
*/
interface Account {}
interface Account { }
/**
* Returned by `useSession`, `auth`, contains information about the active session.

View File

@@ -4,4 +4,4 @@ export interface RequestOptionsWithJSONBody
}
export interface RequestOptionsWithOutBody
extends Omit<RequestInit, "body" | "method"> {}
extends Omit<RequestInit, "body" | "method"> { }

View File

@@ -0,0 +1,27 @@
import type { AllRequestResponse } from "../utils/all"
import type { Edges } from "../utils/edges"
interface AccountPageBreadcrumbs {
breadcrumbs: {
title: string
parents: Edges<{
breadcrumbs: {
title: string
}
system: {
uid: string
}
url: string
}>
}
system: {
uid: string
}
}
interface AllAccountPageResponse
extends AllRequestResponse<AccountPageBreadcrumbs> {}
export interface GetMyPagesBreadcrumbsData {
all_account_page: AllAccountPageResponse
}

View File

@@ -26,26 +26,21 @@ interface NavigationLink {
locale: Lang
uid: string
}
url: string
title: string
}
export interface AccountPageLink
extends NavigationLink,
TypenameInterface<PageLinkEnum.AccountPage> {
url: string
}
TypenameInterface<PageLinkEnum.AccountPage> { }
export interface LoyaltyPageLink
extends NavigationLink,
TypenameInterface<PageLinkEnum.LoyaltyPage> {
url: string
}
TypenameInterface<PageLinkEnum.LoyaltyPage> { }
export interface ContentPageLink
extends NavigationLink,
TypenameInterface<PageLinkEnum.ContentPage> {
url: string
}
TypenameInterface<PageLinkEnum.ContentPage> { }
export type PageLink = ContentPageLink | AccountPageLink | LoyaltyPageLink

View File

@@ -1,4 +1,4 @@
export type AllRequestResponse<T> = {
export interface AllRequestResponse<T> {
items: T[]
total: number
}
}

View File

@@ -29,7 +29,6 @@ type Victory = {
* we have to get the values from elsewhere
*/
export interface User extends z.infer<typeof getUserSchema> {
dob: string
firstName: string
journeys: Journey[]
nights: number