feat(SW-1389): refactor page settings

This commit is contained in:
Michael Zetterberg
2025-02-17 06:15:21 +01:00
parent 504fe7cb99
commit 82ba219e2b
18 changed files with 203 additions and 181 deletions

View File

@@ -1,5 +0,0 @@
import { z } from "zod"
import { Lang } from "@/constants/languages"
export const langInput = z.object({ lang: z.nativeEnum(Lang) })

View File

@@ -18,6 +18,7 @@ import {
import { request } from "@/lib/graphql/request"
import { notFound } from "@/server/errors/trpc"
import { contentstackBaseProcedure, router } from "@/server/trpc"
import { langInput } from "@/server/utils"
import {
generateRefsResponseTag,
@@ -26,7 +27,6 @@ import {
generateTagsFromSystem,
} from "@/utils/generateTag"
import { langInput } from "./input"
import {
type ContactConfigData,
type CurrentFooterDataRaw,
@@ -619,7 +619,7 @@ export const baseQueryRouter = router({
siteConfig: contentstackBaseProcedure
.input(langInput)
.query(async ({ input, ctx }) => {
const lang = input?.lang ?? ctx.lang
const lang = input.lang ?? ctx.lang
getSiteConfigRefCounter.add(1, { lang })
console.info(