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

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
}
}