fix: typings for contactConfig
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user