feat(SW-187): App badges localization
This commit is contained in:
@@ -412,6 +412,12 @@ export const baseQueryRouter = router({
|
||||
GetCurrentFooterRef,
|
||||
{
|
||||
locale: input.lang,
|
||||
},
|
||||
{
|
||||
cache: "force-cache",
|
||||
next: {
|
||||
tags: [generateRefsResponseTag(input.lang, "current_footer")],
|
||||
},
|
||||
}
|
||||
)
|
||||
// There's currently no error handling/validation for the responseRef, should it be added?
|
||||
@@ -424,6 +430,9 @@ export const baseQueryRouter = router({
|
||||
},
|
||||
})
|
||||
)
|
||||
const currentFooterUID =
|
||||
responseRef.data.all_current_footer.items[0].system.uid
|
||||
|
||||
const response = await request<CurrentFooterDataRaw>(
|
||||
GetCurrentFooter,
|
||||
{
|
||||
@@ -431,7 +440,7 @@ export const baseQueryRouter = router({
|
||||
},
|
||||
{
|
||||
next: {
|
||||
tags: [generateRefsResponseTag(input.lang, "current_footer")],
|
||||
tags: [generateTag(input.lang, currentFooterUID)],
|
||||
},
|
||||
}
|
||||
)
|
||||
@@ -490,7 +499,7 @@ export const baseQueryRouter = router({
|
||||
JSON.stringify({ query: { lang: input.lang } })
|
||||
)
|
||||
const responseRef = await request<FooterRefDataRaw>(
|
||||
GetCurrentFooterRef,
|
||||
GetFooterRef,
|
||||
{
|
||||
locale: input.lang,
|
||||
},
|
||||
@@ -501,6 +510,7 @@ export const baseQueryRouter = router({
|
||||
},
|
||||
}
|
||||
)
|
||||
console.log("responseRef", responseRef)
|
||||
// There's currently no error handling/validation for the responseRef, should it be added?
|
||||
getFooterCounter.add(1, { lang: input.lang })
|
||||
console.info(
|
||||
@@ -511,7 +521,7 @@ export const baseQueryRouter = router({
|
||||
},
|
||||
})
|
||||
)
|
||||
const currentFooterUID = responseRef.data.all_footer.items[0].system.uid
|
||||
const footerUID = responseRef.data.all_footer.items[0].system.uid
|
||||
const response = await request<FooterDataRaw>(
|
||||
GetFooter,
|
||||
{
|
||||
@@ -520,7 +530,7 @@ export const baseQueryRouter = router({
|
||||
{
|
||||
cache: "force-cache",
|
||||
next: {
|
||||
tags: [generateTag(input.lang, currentFooterUID)],
|
||||
tags: [generateTag(input.lang, footerUID)],
|
||||
},
|
||||
}
|
||||
)
|
||||
@@ -572,17 +582,19 @@ export const baseQueryRouter = router({
|
||||
const mainLinks = transformPageConnectionLinks(
|
||||
validatedFooterData.main_links
|
||||
)
|
||||
console.log(
|
||||
"secondary_links ",
|
||||
validatedFooterData.secondary_links[0].links[0].pageConnection?.edges
|
||||
)
|
||||
|
||||
const secondaryLinks = validatedFooterData.secondary_links.map(
|
||||
(section) => ({
|
||||
...section,
|
||||
title: section.title,
|
||||
links: transformPageConnectionLinks(section.links),
|
||||
})
|
||||
)
|
||||
|
||||
console.log(
|
||||
"secondaryLinks data",
|
||||
JSON.stringify(secondaryLinks, null, 4)
|
||||
)
|
||||
|
||||
return {
|
||||
mainLinks: mainLinks,
|
||||
appDownloads: validatedFooterData.app_downloads,
|
||||
|
||||
Reference in New Issue
Block a user