feat: handle redirects when searchparams are missing in steps
This commit is contained in:
@@ -346,4 +346,4 @@
|
|||||||
"{amount} {currency}": "{amount} {currency}",
|
"{amount} {currency}": "{amount} {currency}",
|
||||||
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
||||||
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
||||||
}
|
}
|
||||||
@@ -346,4 +346,4 @@
|
|||||||
"{amount} {currency}": "{amount} {currency}",
|
"{amount} {currency}": "{amount} {currency}",
|
||||||
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
||||||
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
||||||
}
|
}
|
||||||
@@ -347,4 +347,4 @@
|
|||||||
"{amount} {currency}": "{amount} {currency}",
|
"{amount} {currency}": "{amount} {currency}",
|
||||||
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
||||||
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
||||||
}
|
}
|
||||||
@@ -343,4 +343,4 @@
|
|||||||
"{amount} {currency}": "{amount} {currency}",
|
"{amount} {currency}": "{amount} {currency}",
|
||||||
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
||||||
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
||||||
}
|
}
|
||||||
@@ -344,4 +344,4 @@
|
|||||||
"{amount} {currency}": "{amount} {currency}",
|
"{amount} {currency}": "{amount} {currency}",
|
||||||
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
"{difference}{amount} {currency}": "{difference}{amount} {currency}",
|
||||||
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
"{width} cm × {length} cm": "{width} cm × {length} cm"
|
||||||
}
|
}
|
||||||
@@ -69,6 +69,102 @@ const nextConfig = {
|
|||||||
|
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// https://nextjs.org/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching
|
||||||
|
redirects() {
|
||||||
|
const bedTypeQuery = {
|
||||||
|
key: "bedType",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
}
|
||||||
|
const breakfastQuery = {
|
||||||
|
key: "breakfast",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
// {
|
||||||
|
// ----------------------------------------
|
||||||
|
// Add all required params that should be
|
||||||
|
// added from Select Room
|
||||||
|
// ----------------------------------------
|
||||||
|
// source: "/:lang/hotelreservation/:path",
|
||||||
|
// destination: "/:lang",
|
||||||
|
// missing: [
|
||||||
|
// {
|
||||||
|
// key: "hotelId",
|
||||||
|
// type: "query",
|
||||||
|
// value: undefined,
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// permanent: false,
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/breakfast",
|
||||||
|
destination: "/:lang/hotelreservation/select-bed",
|
||||||
|
missing: [bedTypeQuery],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/details",
|
||||||
|
destination: "/:lang/hotelreservation/select-bed",
|
||||||
|
missing: [bedTypeQuery],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/details",
|
||||||
|
destination: "/:lang/hotelreservation/breakfast",
|
||||||
|
missing: [breakfastQuery],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/payment",
|
||||||
|
destination: "/:lang/hotelreservation/select-bed",
|
||||||
|
missing: [bedTypeQuery],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/payment",
|
||||||
|
destination: "/:lang/hotelreservation/breakfast",
|
||||||
|
missing: [breakfastQuery],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: "/:lang/hotelreservation/payment",
|
||||||
|
destination: "/:lang/hotelreservation/details",
|
||||||
|
missing: [
|
||||||
|
{
|
||||||
|
key: "countryCode",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "email",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "firstname",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "lastname",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: "phoneNumber",
|
||||||
|
type: "query",
|
||||||
|
value: undefined,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permanent: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
rewrites() {
|
rewrites() {
|
||||||
return {
|
return {
|
||||||
beforeFiles: [
|
beforeFiles: [
|
||||||
|
|||||||
Reference in New Issue
Block a user