From 6443fb61b3e58e10251b108426eaa4540e387e52 Mon Sep 17 00:00:00 2001 From: gestchild Date: Wed, 22 May 2024 17:55:32 +0100 Subject: [PATCH 1/3] fetch webcomics --- .../services/prismic/fetch/stories-landing.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/content/webapp/services/prismic/fetch/stories-landing.ts b/content/webapp/services/prismic/fetch/stories-landing.ts index 7154af398c..7e0179cd9f 100644 --- a/content/webapp/services/prismic/fetch/stories-landing.ts +++ b/content/webapp/services/prismic/fetch/stories-landing.ts @@ -8,6 +8,27 @@ const graphQuery = `{ storiesDescription stories { story { + ... on webcomics { + title + format { + ... on article-formats { + title + } + } + promo { + ... on editorialImage { + non-repeat { + caption + image + } + } + } + series { + series { + title + } + } + } ... on articles { title format { From b11d919e2ec9426e1ba6b29f75cb88d62b915e19 Mon Sep 17 00:00:00 2001 From: gestchild Date: Thu, 23 May 2024 08:14:50 +0100 Subject: [PATCH 2/3] also fetch series, as we allow these to be added to the content list --- .../webapp/services/prismic/fetch/stories-landing.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/webapp/services/prismic/fetch/stories-landing.ts b/content/webapp/services/prismic/fetch/stories-landing.ts index 7e0179cd9f..49af56ad48 100644 --- a/content/webapp/services/prismic/fetch/stories-landing.ts +++ b/content/webapp/services/prismic/fetch/stories-landing.ts @@ -8,6 +8,17 @@ const graphQuery = `{ storiesDescription stories { story { + ... on series { + title + promo { + ... on editorialImage { + non-repeat { + caption + image + } + } + } + } ... on webcomics { title format { From f2d1195e5bdfefa6ef2ba65d146f51f26e3bc59f Mon Sep 17 00:00:00 2001 From: gestchild Date: Thu, 23 May 2024 08:15:18 +0100 Subject: [PATCH 3/3] handle deprecated webcomics --- content/webapp/services/prismic/transformers/stories-landing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/webapp/services/prismic/transformers/stories-landing.ts b/content/webapp/services/prismic/transformers/stories-landing.ts index 7f0309e6ea..1c0c529cba 100644 --- a/content/webapp/services/prismic/transformers/stories-landing.ts +++ b/content/webapp/services/prismic/transformers/stories-landing.ts @@ -14,7 +14,7 @@ import { isFilledLinkToDocumentWithData } from '@weco/common/services/prismic/ty import { asRichText, asText } from '.'; function transformStoryOrSeries(storyOrSeries) { - if (storyOrSeries.type === 'articles') { + if (storyOrSeries.type === 'articles' || storyOrSeries.type === 'webcomics') { return transformArticleToArticleBasic(transformArticle(storyOrSeries)); } else { return transformSeriesToSeriesBasic(transformSeries(storyOrSeries));