diff --git a/apps/scandic-web/lib/graphql/Query/DestinationCityPage/DestinationCityPage.graphql b/apps/scandic-web/lib/graphql/Query/DestinationCityPage/DestinationCityPage.graphql index ea60f6fd5..4dacb2ad1 100644 --- a/apps/scandic-web/lib/graphql/Query/DestinationCityPage/DestinationCityPage.graphql +++ b/apps/scandic-web/lib/graphql/Query/DestinationCityPage/DestinationCityPage.graphql @@ -89,6 +89,19 @@ query GetDestinationCityPage($locale: String!, $uid: String!) { query GetDestinationCityPageRefs($locale: String!, $uid: String!) { destination_city_page(locale: $locale, uid: $uid) { + destination_settings { + city_denmark + city_finland + city_germany + city_norway + city_poland + city_sweden + location { + longitude + latitude + default_zoom + } + } sidepeek_content { content { embedded_itemsConnection { diff --git a/apps/scandic-web/server/routers/contentstack/destinationCityPage/output.ts b/apps/scandic-web/server/routers/contentstack/destinationCityPage/output.ts index b680145cf..32d84fdfb 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationCityPage/output.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationCityPage/output.ts @@ -232,6 +232,7 @@ const blocksRefsSchema = z.discriminatedUnion("__typename", [ export const destinationCityPageRefsSchema = z.object({ destination_city_page: z.object({ + destination_settings: destinationCityPageDestinationSettingsSchema, sidepeek_content: z .object({ content: z.object({ diff --git a/apps/scandic-web/server/routers/contentstack/destinationCityPage/utils.ts b/apps/scandic-web/server/routers/contentstack/destinationCityPage/utils.ts index aa2e516b3..bcf6f6de9 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationCityPage/utils.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationCityPage/utils.ts @@ -29,6 +29,11 @@ export function generatePageTags( ): string[] { const connections = getConnections(validatedData) return [ + // This tag is added for the city list data on country pages to invalidate the list when city page changes. + generateTag( + lang, + `city_list_data:${validatedData.destination_city_page.destination_settings.city}` + ), generateTagsFromSystem(lang, connections), generateTag(lang, validatedData.destination_city_page.system.uid), ].flat() diff --git a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/utils.ts b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/utils.ts index ad2a70ce0..e56c77fc9 100644 --- a/apps/scandic-web/server/routers/contentstack/destinationCountryPage/utils.ts +++ b/apps/scandic-web/server/routers/contentstack/destinationCountryPage/utils.ts @@ -90,7 +90,7 @@ export async function getCityListDataByCityIdentifier( cityIdentifier, }, { - key: `${lang}:city_list_data:${cityIdentifier}`, + key: generateTag(lang, `city_list_data:${cityIdentifier}`), ttl: "max", } )