Skip to content

Commit

Permalink
Merge pull request #10960 from wellcomecollection/add-missing-type
Browse files Browse the repository at this point in the history
add missing type
  • Loading branch information
gestchild authored Jun 19, 2024
2 parents e53b17e + 54bcba0 commit be9d48e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions content/webapp/services/prismic/transformers/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 || [])
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit be9d48e

Please sign in to comment.