This is the foundation for the rate selection. Since we don't have UX and UI ready yet this is on a best effort basis. Things that will be changed later includes proper API fetching, correct design, internationalization of text and form handling.
19 lines
535 B
TypeScript
19 lines
535 B
TypeScript
import { NextResponse } from "next/server"
|
|
|
|
import { hotelReservation } from "@/constants/routes/hotelReservation"
|
|
|
|
import { findLang } from "@/utils/languages"
|
|
|
|
import type { NextMiddleware } from "next/server"
|
|
|
|
import type { MiddlewareMatcher } from "@/types/middleware"
|
|
|
|
export const middleware: NextMiddleware = () => {
|
|
return NextResponse.next()
|
|
}
|
|
|
|
export const matcher: MiddlewareMatcher = (request) => {
|
|
const lang = findLang(request.nextUrl.pathname)!
|
|
return request.nextUrl.pathname.startsWith(hotelReservation[lang])
|
|
}
|