refactor: change name on breadcrumbs unique id for loyalty page
This commit is contained in:
@@ -22,7 +22,7 @@ fragment AccountPageBreadcrumbs on AccountPage {
|
||||
|
||||
fragment LoyaltyPageBreadcrumbs on LoyaltyPage {
|
||||
web {
|
||||
breadcrumbss {
|
||||
breadcrumbs {
|
||||
title
|
||||
parentsConnection {
|
||||
edges {
|
||||
|
||||
@@ -21,7 +21,7 @@ fragment AccountPageBreadcrumbsRefs on AccountPage {
|
||||
|
||||
fragment LoyaltyPageBreadcrumbsRefs on LoyaltyPage {
|
||||
web {
|
||||
breadcrumbss {
|
||||
breadcrumbs {
|
||||
title
|
||||
parentsConnection {
|
||||
edges {
|
||||
|
||||
@@ -73,7 +73,7 @@ export const validateBreadcrumbsRefsContenstackSchemaLoyalty = z.object({
|
||||
items: z.array(
|
||||
z.object({
|
||||
web: z.object({
|
||||
breadcrumbss: z.object({
|
||||
breadcrumbs: z.object({
|
||||
parentsConnection: z.object({
|
||||
edges: z.array(
|
||||
z.object({
|
||||
@@ -102,7 +102,7 @@ export const validateBreadcrumbsContenstackSchemaLoyalty = z.object({
|
||||
items: z.array(
|
||||
z.object({
|
||||
web: z.object({
|
||||
breadcrumbss: z.object({
|
||||
breadcrumbs: z.object({
|
||||
title: z.string(),
|
||||
parentsConnection: z.object({
|
||||
edges: z.array(
|
||||
|
||||
@@ -163,7 +163,7 @@ export const breadcrumbsQueryRouter = router({
|
||||
}
|
||||
|
||||
const parentBreadcrumbs =
|
||||
validatedBreadcrumbsData.data.all_loyalty_page.items[0].web.breadcrumbss.parentsConnection.edges.map(
|
||||
validatedBreadcrumbsData.data.all_loyalty_page.items[0].web.breadcrumbs.parentsConnection.edges.map(
|
||||
(breadcrumb) => {
|
||||
return {
|
||||
href: removeMultipleSlashes(
|
||||
@@ -178,7 +178,7 @@ export const breadcrumbsQueryRouter = router({
|
||||
const pageBreadcrumb =
|
||||
validatedBreadcrumbsData.data.all_loyalty_page.items.map((breadcrumb) => {
|
||||
return {
|
||||
title: breadcrumb.web.breadcrumbss.title,
|
||||
title: breadcrumb.web.breadcrumbs.title,
|
||||
uid: breadcrumb.system.uid,
|
||||
}
|
||||
})
|
||||
|
||||
@@ -22,9 +22,7 @@ export function getConnectionsLoyalty(refs: GetLoyaltyPageBreadcrumbsRefsData) {
|
||||
const connections: Edges<NodeRefs>[] = []
|
||||
refs.all_loyalty_page.items.forEach((ref) => {
|
||||
console.log(ref)
|
||||
console.log(ref.web.breadcrumbss)
|
||||
console.log(ref.web.breadcrumbss.parentsConnection)
|
||||
connections.push(ref.web.breadcrumbss.parentsConnection)
|
||||
connections.push(ref.web.breadcrumbs.parentsConnection)
|
||||
})
|
||||
console.log(connections)
|
||||
return connections
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { BreadcrumbsProps } from "./breadcrumbs"
|
||||
import type { Preamble } from "@/types/requests/preamble"
|
||||
import type { BreadcrumbsProps } from "./breadcrumbs"
|
||||
|
||||
export type PreambleProps = {
|
||||
breadcrumbs: BreadcrumbsProps["breadcrumbs"]
|
||||
|
||||
@@ -24,7 +24,7 @@ interface AccountPageBreadcrumbs {
|
||||
}
|
||||
interface LoyaltyPageBreadcrumbs {
|
||||
web: {
|
||||
breadcrumbss: {
|
||||
breadcrumbs: {
|
||||
title: string
|
||||
parentsConnection: Edges<{
|
||||
breadcrumbs: {
|
||||
@@ -65,7 +65,7 @@ interface AccountPageBreadcrumbRefs extends System {
|
||||
|
||||
interface LoyaltyPageBreadcrumbRefs extends System {
|
||||
web: {
|
||||
breadcrumbss: {
|
||||
breadcrumbs: {
|
||||
parentsConnection: Edges<System>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user