fix: replace content_type_id with __typename
This commit is contained in:
@@ -35,7 +35,7 @@ export default async function CurrentContentPage({
|
|||||||
const pageData = response.data.all_current_blocks_page.items[0]
|
const pageData = response.data.all_current_blocks_page.items[0]
|
||||||
const trackingData = {
|
const trackingData = {
|
||||||
pageName: pageData.title,
|
pageName: pageData.title,
|
||||||
pageType: pageData.system.content_type_uid,
|
pageType: pageData.__typename,
|
||||||
publishedDate: pageData.system.updated_at,
|
publishedDate: pageData.system.updated_at,
|
||||||
createdDate: pageData.system.created_at,
|
createdDate: pageData.system.created_at,
|
||||||
pageId: pageData.system.uid,
|
pageId: pageData.system.uid,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
query GetCurrentBlockPage($locale: String!, $url: String!) {
|
query GetCurrentBlockPage($locale: String!, $url: String!) {
|
||||||
all_current_blocks_page(limit: 1, locale: $locale, where: { url: $url }) {
|
all_current_blocks_page(limit: 1, locale: $locale, where: { url: $url }) {
|
||||||
items {
|
items {
|
||||||
|
__typename
|
||||||
aside {
|
aside {
|
||||||
__typename
|
__typename
|
||||||
...ContactAside
|
...ContactAside
|
||||||
@@ -30,7 +31,6 @@ query GetCurrentBlockPage($locale: String!, $url: String!) {
|
|||||||
url
|
url
|
||||||
system {
|
system {
|
||||||
uid
|
uid
|
||||||
content_type_uid
|
|
||||||
created_at
|
created_at
|
||||||
updated_at
|
updated_at
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ import type { PuffBlock } from "./blocks/puff"
|
|||||||
import type { Preamble } from "./preamble"
|
import type { Preamble } from "./preamble"
|
||||||
import type { Text } from "./blocks/text"
|
import type { Text } from "./blocks/text"
|
||||||
import type { AllRequestResponse } from "./utils/all"
|
import type { AllRequestResponse } from "./utils/all"
|
||||||
import type { AsideTypenameEnum, Typename } from "./utils/typename"
|
import type {
|
||||||
|
AsideTypenameEnum,
|
||||||
|
Typename,
|
||||||
|
PagesTypenameEnum,
|
||||||
|
} from "./utils/typename"
|
||||||
import type { EmbedEnum } from "./utils/embeds"
|
import type { EmbedEnum } from "./utils/embeds"
|
||||||
import type { Edges } from "./utils/edges"
|
import type { Edges } from "./utils/edges"
|
||||||
|
|
||||||
@@ -41,6 +45,7 @@ export type Breadcrumbs = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type BlockPage = {
|
export type BlockPage = {
|
||||||
|
__typename: PagesTypenameEnum.CurrentBlocksPage
|
||||||
aside: Asides[]
|
aside: Asides[]
|
||||||
blocks: Blocks[]
|
blocks: Blocks[]
|
||||||
breadcrumbs: Breadcrumbs
|
breadcrumbs: Breadcrumbs
|
||||||
@@ -50,7 +55,6 @@ export type BlockPage = {
|
|||||||
url: string
|
url: string
|
||||||
system: {
|
system: {
|
||||||
uid: string
|
uid: string
|
||||||
content_type_uid: string // should this be locked down to the specific enum?
|
|
||||||
created_at: string
|
created_at: string
|
||||||
updated_at: string
|
updated_at: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ export enum BlocksTypenameEnum {
|
|||||||
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
CurrentBlocksPageBlocksText = "CurrentBlocksPageBlocksText",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum PagesTypenameEnum {
|
||||||
|
CurrentBlocksPage = "CurrentBlocksPage",
|
||||||
|
}
|
||||||
|
|
||||||
export type BlocksTypename = keyof typeof BlocksTypenameEnum
|
export type BlocksTypename = keyof typeof BlocksTypenameEnum
|
||||||
|
|
||||||
export type Typename<T, K> = T & {
|
export type Typename<T, K> = T & {
|
||||||
|
|||||||
Reference in New Issue
Block a user