Merged in fix/clean-up-redirects (pull request #695)

fix: redirect clean up

Approved-by: Arvid Norlin
This commit is contained in:
Simon.Emanuelsson
2024-10-15 08:43:31 +00:00

View File

@@ -72,66 +72,6 @@ const nextConfig = {
// https://nextjs.org/docs/app/api-reference/next-config-js/redirects#header-cookie-and-query-matching
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 = {
key: "bedType",
type: "query",
value: undefined,
}
const breakfastQuery = {
key: "breakfast",
type: "query",
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 [
// {
// ----------------------------------------
@@ -140,43 +80,84 @@ const nextConfig = {
// ----------------------------------------
// source: "/:lang/hotelreservation/(select-bed|breakfast|details|payment)",
// destination: "/:lang/hotelreservation/select-rate",
// missing: rateQueries,
// missing: [
// {
// key: "hotel",
// type: "query",
// value: undefined,
// },
// {
// key: "fromdate",
// type: "query",
// value: undefined,
// },
// {
// key: "todate",
// type: "query",
// value: undefined,
// },
// {
// key: "room",
// type: "query",
// value: undefined,
// },
// ],
// permanent: false,
// },
{
source: "/:lang/hotelreservation/breakfast",
source: "/:lang/hotelreservation/(breakfast|details|payment)",
destination: "/:lang/hotelreservation/select-bed",
missing: [bedTypeQuery],
missing: [
{
key: "bedType",
type: "query",
value: undefined,
},
],
permanent: false,
},
{
source: "/:lang/hotelreservation/details",
destination: "/:lang/hotelreservation/select-bed",
missing: [bedTypeQuery],
permanent: false,
},
{
source: "/:lang/hotelreservation/details",
source: "/:lang/hotelreservation/(details|payment)",
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],
missing: [
{
key: "breakfast",
type: "query",
value: undefined,
},
],
permanent: false,
},
{
source: "/:lang/hotelreservation/payment",
destination: "/:lang/hotelreservation/details",
missing: detailQueries,
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,
},
]