fix: add content-page handling in languageSwitcher query

This commit is contained in:
Arvid Norlin
2024-08-14 11:54:16 +02:00
committed by Erik Tiekstra
parent 8220a39a8f
commit a01aa10bf2
3 changed files with 55 additions and 0 deletions

View File

@@ -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<LanguageSwitcherQueryDataRaw>([
{
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`)