Files
web/middlewares/bookingFlow.ts
Niclas Edenvin d6fe6a33b4 feat(SW-70): create base for rate selection page
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.
2024-07-09 13:25:26 +02:00

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])
}