fix: redirect clean up

This commit is contained in:
Simon Emanuelsson
2024-10-15 09:12:17 +02:00
parent 7a6af05447
commit d42c0c0a77

View File

@@ -72,7 +72,15 @@ 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 = [ return [
// {
// ----------------------------------------
// Uncomment when Team Explorer has deployed
// the select room submission
// ----------------------------------------
// source: "/:lang/hotelreservation/(select-bed|breakfast|details|payment)",
// destination: "/:lang/hotelreservation/select-rate",
// missing: [
// { // {
// key: "hotel", // key: "hotel",
// type: "query", // type: "query",
@@ -93,18 +101,37 @@ const nextConfig = {
// type: "query", // type: "query",
// value: undefined, // value: undefined,
// }, // },
// ] // ],
const bedTypeQuery = { // permanent: false,
// },
{
source: "/:lang/hotelreservation/(breakfast|details|payment)",
destination: "/:lang/hotelreservation/select-bed",
missing: [
{
key: "bedType", key: "bedType",
type: "query", type: "query",
value: undefined, value: undefined,
} },
const breakfastQuery = { ],
permanent: false,
},
{
source: "/:lang/hotelreservation/(details|payment)",
destination: "/:lang/hotelreservation/breakfast",
missing: [
{
key: "breakfast", key: "breakfast",
type: "query", type: "query",
value: undefined, value: undefined,
} },
const detailQueries = [ ],
permanent: false,
},
{
source: "/:lang/hotelreservation/payment",
destination: "/:lang/hotelreservation/details",
missing: [
{ {
key: "countryCode", key: "countryCode",
type: "query", type: "query",
@@ -130,53 +157,7 @@ const nextConfig = {
type: "query", type: "query",
value: undefined, value: undefined,
}, },
] ],
return [
// {
// ----------------------------------------
// Uncomment when Team Explorer has deployed
// the select room submission
// ----------------------------------------
// source: "/:lang/hotelreservation/(select-bed|breakfast|details|payment)",
// destination: "/:lang/hotelreservation/select-rate",
// missing: rateQueries,
// 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: detailQueries,
permanent: false, permanent: false,
}, },
] ]