fix: typings for contactConfig

This commit is contained in:
Christel Westerberg
2024-04-18 11:44:52 +02:00
parent c00f7b78eb
commit b57665ce62
4 changed files with 106 additions and 38 deletions

View File

@@ -10,7 +10,7 @@ export const middleware: NextMiddleware = async (request) => {
const { nextUrl } = request
const lang = findLang(nextUrl.pathname)
const contentType = "currentContentPage"
const contentType = "loyaltyPage"
const pathNameWithoutLang = nextUrl.pathname.replace(`/${lang}`, "")
const searchParams = new URLSearchParams(request.nextUrl.searchParams)
@@ -23,12 +23,16 @@ export const middleware: NextMiddleware = async (request) => {
searchParams.set("uri", pathNameWithoutLang)
switch (contentType) {
case "currentContentPage":
// case "currentContentPage":
// return NextResponse.rewrite(
// new URL(
// `/${lang}/current-content-page?${searchParams.toString()}`,
// nextUrl
// )
// )
case "loyaltyPage":
return NextResponse.rewrite(
new URL(
`/${lang}/current-content-page?${searchParams.toString()}`,
nextUrl
)
new URL(`/${lang}/loyalty-page?${searchParams.toString()}`, nextUrl)
)
default:
return NextResponse.next()