diff --git a/lib/graphql/Query/ContentPage.graphql b/lib/graphql/Query/ContentPage.graphql index ff7c0d24d..4d3076e14 100644 --- a/lib/graphql/Query/ContentPage.graphql +++ b/lib/graphql/Query/ContentPage.graphql @@ -17,3 +17,39 @@ query GetContentPage($locale: String!, $uid: String!) { } } } + +query GetDaDeEnUrlsContentPage($uid: String!) { + de: all_content_page(where: { uid: $uid }, locale: "de") { + items { + url + } + } + en: all_content_page(where: { uid: $uid }, locale: "en") { + items { + url + } + } + da: all_content_page(where: { uid: $uid }, locale: "da") { + items { + url + } + } +} + +query GetFiNoSvUrlsContentPage($uid: String!) { + fi: all_content_page(where: { uid: $uid }, locale: "fi") { + items { + url + } + } + no: all_content_page(where: { uid: $uid }, locale: "no") { + items { + url + } + } + sv: all_content_page(where: { uid: $uid }, locale: "sv") { + items { + url + } + } +} diff --git a/server/routers/contentstack/languageSwitcher/query.ts b/server/routers/contentstack/languageSwitcher/query.ts index a41fd2a99..35b8a3ded 100644 --- a/server/routers/contentstack/languageSwitcher/query.ts +++ b/server/routers/contentstack/languageSwitcher/query.ts @@ -5,6 +5,10 @@ import { GetDaDeEnUrlsAccountPage, GetFiNoSvUrlsAccountPage, } from "@/lib/graphql/Query/AccountPage.graphql" +import { + GetDaDeEnUrlsContentPage, + GetFiNoSvUrlsContentPage, +} from "@/lib/graphql/Query/ContentPage.graphql" import { GetDaDeEnUrlsHotelPage, GetFiNoSvUrlsHotelPage, @@ -101,6 +105,20 @@ async function getLanguageSwitcher(options: LanguageSwitcherVariables) { tags: tagsFiNoSv, }, ]) + case PageTypeEnum.contentPage: + return await batchRequest([ + { + document: GetDaDeEnUrlsContentPage, + variables, + tags: tagsDaDeEn, + }, + { + document: GetFiNoSvUrlsContentPage, + variables, + tags: tagsFiNoSv, + }, + ]) + default: console.error(`type: [${options.contentType}]`) console.error(`Trying to get a content type that is not supported`) diff --git a/types/requests/pageType.ts b/types/requests/pageType.ts index 993a697e4..001e6a486 100644 --- a/types/requests/pageType.ts +++ b/types/requests/pageType.ts @@ -2,5 +2,6 @@ export enum PageTypeEnum { accountPage = "account-page", loyaltyPage = "loyalty-page", hotelPage = "hotel-page", + contentPage = "content-page", currentBlocksPage = "current-blocks-page", }