From 54bcba03de0bc2a2633ba571b38d303f1501f551 Mon Sep 17 00:00:00 2001 From: gestchild Date: Wed, 19 Jun 2024 17:30:12 +0100 Subject: [PATCH] add missing type --- content/webapp/services/prismic/transformers/pages.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/webapp/services/prismic/transformers/pages.ts b/content/webapp/services/prismic/transformers/pages.ts index b68b2569ac..97e1badd2f 100644 --- a/content/webapp/services/prismic/transformers/pages.ts +++ b/content/webapp/services/prismic/transformers/pages.ts @@ -2,6 +2,7 @@ import { Page } from '@weco/content/types/pages'; import { PagesDocument as RawPagesDocument, SeasonsDocument as RawSeasonsDocument, + PagesDocumentData as RawPagesDocumentData, } from '@weco/common/prismicio-types'; import { links as headerLinks } from '@weco/common/views/components/Header/Header'; import { @@ -19,7 +20,9 @@ import { isNotUndefined, isUndefined } from '@weco/common/utils/type-guards'; import { transformTimestamp } from '@weco/common/services/prismic/transformers'; import { SiteSection } from '@weco/common/views/components/PageLayout/PageLayout'; -export function transformOnThisPage(body): Link[] { +export function transformOnThisPage( + body: RawPagesDocumentData['body'] +): Link[] { return flattenDeep( body.map(slice => slice.primary.title || slice.primary.text || []) ) @@ -98,7 +101,7 @@ export function transformPage(document: RawPagesDocument): Page { seasons, contributors, parentPages, - onThisPage: data.body ? transformOnThisPage(data.body) : [], // TODO? + onThisPage: data.body ? transformOnThisPage(data.body) : [], showOnThisPage: data.showOnThisPage || false, promo, datePublished: data.datePublished