Merged in feat/SW-599 (pull request #688)

feat: add commented out prep for path redirects when missing params

Approved-by: Arvid Norlin
This commit is contained in:
Simon.Emanuelsson
2024-10-14 13:05:25 +00:00

View File

@@ -72,6 +72,28 @@ const nextConfig = {
// https://nextjs.org/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching // https://nextjs.org/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching
redirects() { redirects() {
// const rateQueries = [
// {
// key: "hotel",
// type: "query",
// value: undefined,
// },
// {
// key: "fromdate",
// type: "query",
// value: undefined,
// },
// {
// key: "todate",
// type: "query",
// value: undefined,
// },
// {
// key: "room",
// type: "query",
// value: undefined,
// },
// ]
const bedTypeQuery = { const bedTypeQuery = {
key: "bedType", key: "bedType",
type: "query", type: "query",
@@ -82,22 +104,43 @@ const nextConfig = {
type: "query", type: "query",
value: undefined, value: undefined,
} }
const detailQueries = [
{
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,
},
]
return [ return [
// { // {
// ---------------------------------------- // ----------------------------------------
// Add all required params that should be // Uncomment when Team Explorer has deployed
// added from Select Room // the select room submission
// ---------------------------------------- // ----------------------------------------
// source: "/:lang/hotelreservation/:path", // source: "/:lang/hotelreservation/(select-bed|breakfast|details|payment)",
// destination: "/:lang", // destination: "/:lang/hotelreservation/select-rate",
// missing: [ // missing: rateQueries,
// {
// key: "hotelId",
// type: "query",
// value: undefined,
// },
// ],
// permanent: false, // permanent: false,
// }, // },
{ {
@@ -133,33 +176,7 @@ const nextConfig = {
{ {
source: "/:lang/hotelreservation/payment", source: "/:lang/hotelreservation/payment",
destination: "/:lang/hotelreservation/details", destination: "/:lang/hotelreservation/details",
missing: [ missing: detailQueries,
{
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, permanent: false,
}, },
] ]