refactor: update names
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
fragment MyPagesBreadcrumbs on AccountPage {
|
fragment AccountPageBreadcrumbs on AccountPage {
|
||||||
breadcrumbs {
|
breadcrumbs {
|
||||||
title
|
title
|
||||||
parentsConnection {
|
parentsConnection {
|
||||||
@@ -20,7 +20,7 @@ fragment MyPagesBreadcrumbs on AccountPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment LoyaltyBreadcrumbs on LoyaltyPage {
|
fragment LoyaltyPageBreadcrumbs on LoyaltyPage {
|
||||||
web {
|
web {
|
||||||
breadcrumbss {
|
breadcrumbss {
|
||||||
title
|
title
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#import "./System.graphql"
|
#import "./System.graphql"
|
||||||
|
|
||||||
fragment MyPagesBreadcrumbsRefs on AccountPage {
|
fragment AccountPageBreadcrumbsRefs on AccountPage {
|
||||||
breadcrumbs {
|
breadcrumbs {
|
||||||
parentsConnection {
|
parentsConnection {
|
||||||
edges {
|
edges {
|
||||||
@@ -19,7 +19,7 @@ fragment MyPagesBreadcrumbsRefs on AccountPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fragment LoyaltyBreadcrumbsRefs on LoyaltyPage {
|
fragment LoyaltyPageBreadcrumbsRefs on LoyaltyPage {
|
||||||
web {
|
web {
|
||||||
breadcrumbss {
|
breadcrumbss {
|
||||||
title
|
title
|
||||||
@@ -31,11 +31,8 @@ fragment LoyaltyBreadcrumbsRefs on LoyaltyPage {
|
|||||||
title
|
title
|
||||||
}
|
}
|
||||||
system {
|
system {
|
||||||
uid
|
...System
|
||||||
locale
|
|
||||||
content_type_uid
|
|
||||||
}
|
}
|
||||||
url
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#import "../Fragments/MyPages/Breadcrumbs.graphql"
|
#import "../Fragments/MyPages/Breadcrumbs.graphql"
|
||||||
#import "../Fragments/Refs/Breadcrumbs.graphql"
|
#import "../Fragments/Refs/Breadcrumbs.graphql"
|
||||||
|
|
||||||
query GetMyPagesBreadcrumbs($locale: String!, $url: String!) {
|
query GetAccountPageBreadcrumbs($locale: String!, $url: String!) {
|
||||||
all_account_page(locale: $locale, where: { url: $url }) {
|
all_account_page(locale: $locale, where: { url: $url }) {
|
||||||
items {
|
items {
|
||||||
...MyPagesBreadcrumbs
|
...AccountPageBreadcrumbs
|
||||||
system {
|
system {
|
||||||
uid
|
uid
|
||||||
}
|
}
|
||||||
@@ -12,10 +12,10 @@ query GetMyPagesBreadcrumbs($locale: String!, $url: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetMyPagesBreadcrumbsRefs($locale: String!, $url: String!) {
|
query GetAccountPageBreadcrumbsRefs($locale: String!, $url: String!) {
|
||||||
all_account_page(locale: $locale, where: { url: $url }) {
|
all_account_page(locale: $locale, where: { url: $url }) {
|
||||||
items {
|
items {
|
||||||
...MyPagesBreadcrumbsRefs
|
...AccountPageBreadcrumbsRefs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
#import "../Fragments/MyPages/Breadcrumbs.graphql"
|
#import "../Fragments/MyPages/Breadcrumbs.graphql"
|
||||||
#import "../Fragments/Refs/Breadcrumbs.graphql"
|
#import "../Fragments/Refs/Breadcrumbs.graphql"
|
||||||
|
|
||||||
query GetLoyaltyBreadcrumbs($locale: String!, $url: String!) {
|
query GetLoyaltyPageBreadcrumbs($locale: String!, $url: String!) {
|
||||||
all_loyalty_page(locale: $locale, where: { url: $url }) {
|
all_loyalty_page(locale: $locale, where: { url: $url }) {
|
||||||
items {
|
items {
|
||||||
...LoyaltyBreadcrumbs
|
...LoyaltyPageBreadcrumbs
|
||||||
system {
|
system {
|
||||||
uid
|
uid
|
||||||
}
|
}
|
||||||
@@ -12,10 +12,10 @@ query GetLoyaltyBreadcrumbs($locale: String!, $url: String!) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
query GetLoyaltyBreadcrumbsRefs($locale: String!, $url: String!) {
|
query GetLoyaltyPageBreadcrumbsRefs($locale: String!, $url: String!) {
|
||||||
all_loyalty_page(locale: $locale, where: { url: $url }) {
|
all_loyalty_page(locale: $locale, where: { url: $url }) {
|
||||||
items {
|
items {
|
||||||
...LoyaltyBreadcrumbsRefs
|
...LoyaltyPageBreadcrumbsRefs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
GetLoyaltyBreadcrumbs,
|
GetAccountPageBreadcrumbs,
|
||||||
GetLoyaltyBreadcrumbsRefs,
|
GetAccountPageBreadcrumbsRefs,
|
||||||
} from "@/lib/graphql/Query/BreadcrumbsLoyaltyPages.graphql"
|
} from "@/lib/graphql/Query/BreadcrumbsAccountPage.graphql"
|
||||||
import {
|
import {
|
||||||
GetMyPagesBreadcrumbs,
|
GetLoyaltyPageBreadcrumbs,
|
||||||
GetMyPagesBreadcrumbsRefs,
|
GetLoyaltyPageBreadcrumbsRefs,
|
||||||
} from "@/lib/graphql/Query/BreadcrumbsMyPages.graphql"
|
} from "@/lib/graphql/Query/BreadcrumbsLoyaltyPage.graphql"
|
||||||
import { request } from "@/lib/graphql/request"
|
import { request } from "@/lib/graphql/request"
|
||||||
import { internalServerError, notFound } from "@/server/errors/trpc"
|
import { internalServerError, notFound } from "@/server/errors/trpc"
|
||||||
import { contentstackProcedure, router } from "@/server/trpc"
|
import { contentstackProcedure, router } from "@/server/trpc"
|
||||||
@@ -32,16 +32,16 @@ import {
|
|||||||
} from "./utils"
|
} from "./utils"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
GetLoyaltyBreadcrumbsData,
|
GetAccountPageBreadcrumbsData,
|
||||||
GetLoyaltyBreadcrumbsRefsData,
|
GetAccountPageBreadcrumbsRefsData,
|
||||||
GetMyPagesBreadcrumbsData,
|
GetLoyaltyPageBreadcrumbsData,
|
||||||
GetMyPagesBreadcrumbsRefsData,
|
GetLoyaltyPageBreadcrumbsRefsData,
|
||||||
} from "@/types/requests/myPages/breadcrumbs"
|
} from "@/types/requests/myPages/breadcrumbs"
|
||||||
|
|
||||||
export const breadcrumbsQueryRouter = router({
|
export const breadcrumbsQueryRouter = router({
|
||||||
get: contentstackProcedure.query(async ({ ctx }) => {
|
get: contentstackProcedure.query(async ({ ctx }) => {
|
||||||
const refsResponse = await request<GetMyPagesBreadcrumbsRefsData>(
|
const refsResponse = await request<GetAccountPageBreadcrumbsRefsData>(
|
||||||
GetMyPagesBreadcrumbsRefs,
|
GetAccountPageBreadcrumbsRefs,
|
||||||
{ locale: ctx.lang, url: ctx.pathname },
|
{ locale: ctx.lang, url: ctx.pathname },
|
||||||
{
|
{
|
||||||
next: {
|
next: {
|
||||||
@@ -71,8 +71,8 @@ export const breadcrumbsQueryRouter = router({
|
|||||||
tags.push(generateTag(ctx.lang, page.system.uid, affix))
|
tags.push(generateTag(ctx.lang, page.system.uid, affix))
|
||||||
console.log(tags)
|
console.log(tags)
|
||||||
|
|
||||||
const response = await request<GetMyPagesBreadcrumbsData>(
|
const response = await request<GetAccountPageBreadcrumbsData>(
|
||||||
GetMyPagesBreadcrumbs,
|
GetAccountPageBreadcrumbs,
|
||||||
{ locale: ctx.lang, url: ctx.pathname },
|
{ locale: ctx.lang, url: ctx.pathname },
|
||||||
{ next: { tags } }
|
{ next: { tags } }
|
||||||
)
|
)
|
||||||
@@ -125,8 +125,8 @@ export const breadcrumbsQueryRouter = router({
|
|||||||
}),
|
}),
|
||||||
loyalty: contentstackProcedure.query(async ({ ctx }) => {
|
loyalty: contentstackProcedure.query(async ({ ctx }) => {
|
||||||
console.log("HEJ", ctx)
|
console.log("HEJ", ctx)
|
||||||
const refsResponse = await request<GetLoyaltyBreadcrumbsRefsData>(
|
const refsResponse = await request<GetLoyaltyPageBreadcrumbsRefsData>(
|
||||||
GetLoyaltyBreadcrumbsRefs,
|
GetLoyaltyPageBreadcrumbsRefs,
|
||||||
{ locale: ctx.lang, url: ctx.pathname },
|
{ locale: ctx.lang, url: ctx.pathname },
|
||||||
{
|
{
|
||||||
next: {
|
next: {
|
||||||
@@ -170,8 +170,8 @@ export const breadcrumbsQueryRouter = router({
|
|||||||
tags.push(generateTag(ctx.lang, page.system.uid, affix))
|
tags.push(generateTag(ctx.lang, page.system.uid, affix))
|
||||||
console.log(tags)
|
console.log(tags)
|
||||||
|
|
||||||
const response = await request<GetLoyaltyBreadcrumbsData>(
|
const response = await request<GetLoyaltyPageBreadcrumbsData>(
|
||||||
GetLoyaltyBreadcrumbs,
|
GetLoyaltyPageBreadcrumbs,
|
||||||
{ locale: ctx.lang, url: ctx.pathname },
|
{ locale: ctx.lang, url: ctx.pathname },
|
||||||
{ next: { tags } }
|
{ next: { tags } }
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Lang } from "@/constants/languages"
|
import { Lang } from "@/constants/languages"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
GetLoyaltyBreadcrumbsRefsData,
|
GetAccountPageBreadcrumbsRefsData,
|
||||||
GetMyPagesBreadcrumbsRefsData,
|
GetLoyaltyPageBreadcrumbsRefsData,
|
||||||
} from "@/types/requests/myPages/breadcrumbs"
|
} from "@/types/requests/myPages/breadcrumbs"
|
||||||
import type { Edges } from "@/types/requests/utils/edges"
|
import type { Edges } from "@/types/requests/utils/edges"
|
||||||
import type { NodeRefs } from "@/types/requests/utils/refs"
|
import type { NodeRefs } from "@/types/requests/utils/refs"
|
||||||
|
|
||||||
export function getConnections(refs: GetMyPagesBreadcrumbsRefsData) {
|
export function getConnections(refs: GetAccountPageBreadcrumbsRefsData) {
|
||||||
const connections: Edges<NodeRefs>[] = []
|
const connections: Edges<NodeRefs>[] = []
|
||||||
refs.all_account_page.items.forEach((ref) => {
|
refs.all_account_page.items.forEach((ref) => {
|
||||||
console.log(ref)
|
console.log(ref)
|
||||||
@@ -18,7 +18,7 @@ export function getConnections(refs: GetMyPagesBreadcrumbsRefsData) {
|
|||||||
return connections
|
return connections
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getConnectionsLoyalty(refs: GetLoyaltyBreadcrumbsRefsData) {
|
export function getConnectionsLoyalty(refs: GetLoyaltyPageBreadcrumbsRefsData) {
|
||||||
const connections: Edges<NodeRefs>[] = []
|
const connections: Edges<NodeRefs>[] = []
|
||||||
refs.all_loyalty_page.items.forEach((ref) => {
|
refs.all_loyalty_page.items.forEach((ref) => {
|
||||||
console.log(ref)
|
console.log(ref)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ interface AccountPageBreadcrumbs {
|
|||||||
uid: string
|
uid: string
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
interface LoyaltyBreadcrumbs {
|
interface LoyaltyPageBreadcrumbs {
|
||||||
web: {
|
web: {
|
||||||
breadcrumbss: {
|
breadcrumbss: {
|
||||||
title: string
|
title: string
|
||||||
@@ -47,13 +47,13 @@ interface AllAccountPageResponse
|
|||||||
extends AllRequestResponse<AccountPageBreadcrumbs> {}
|
extends AllRequestResponse<AccountPageBreadcrumbs> {}
|
||||||
|
|
||||||
interface AllLoyaltyPageResponse
|
interface AllLoyaltyPageResponse
|
||||||
extends AllRequestResponse<LoyaltyBreadcrumbs> {}
|
extends AllRequestResponse<LoyaltyPageBreadcrumbs> {}
|
||||||
|
|
||||||
export interface GetMyPagesBreadcrumbsData {
|
export interface GetAccountPageBreadcrumbsData {
|
||||||
all_account_page: AllAccountPageResponse
|
all_account_page: AllAccountPageResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetLoyaltyBreadcrumbsData {
|
export interface GetLoyaltyPageBreadcrumbsData {
|
||||||
all_loyalty_page: AllLoyaltyPageResponse
|
all_loyalty_page: AllLoyaltyPageResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ interface AccountPageBreadcrumbRefs extends System {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interface LoyaltyBreadcrumbRefs extends System {
|
interface LoyaltyPageBreadcrumbRefs extends System {
|
||||||
web: {
|
web: {
|
||||||
breadcrumbss: {
|
breadcrumbss: {
|
||||||
parentsConnection: Edges<System>
|
parentsConnection: Edges<System>
|
||||||
@@ -75,12 +75,12 @@ interface AllAccountPageRefsResponse
|
|||||||
extends AllRequestResponse<AccountPageBreadcrumbRefs> {}
|
extends AllRequestResponse<AccountPageBreadcrumbRefs> {}
|
||||||
|
|
||||||
interface AllLoyaltyPageRefsResponse
|
interface AllLoyaltyPageRefsResponse
|
||||||
extends AllRequestResponse<LoyaltyBreadcrumbRefs> {}
|
extends AllRequestResponse<LoyaltyPageBreadcrumbRefs> {}
|
||||||
|
|
||||||
export interface GetMyPagesBreadcrumbsRefsData {
|
export interface GetAccountPageBreadcrumbsRefsData {
|
||||||
all_account_page: AllAccountPageRefsResponse
|
all_account_page: AllAccountPageRefsResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GetLoyaltyBreadcrumbsRefsData {
|
export interface GetLoyaltyPageBreadcrumbsRefsData {
|
||||||
all_loyalty_page: AllLoyaltyPageRefsResponse
|
all_loyalty_page: AllLoyaltyPageRefsResponse
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user