From d42c0c0a7764b8935a579f4683b54d882ce38d46 Mon Sep 17 00:00:00 2001 From: Simon Emanuelsson Date: Tue, 15 Oct 2024 09:12:17 +0200 Subject: [PATCH] fix: redirect clean up --- next.config.js | 149 +++++++++++++++++++++---------------------------- 1 file changed, 65 insertions(+), 84 deletions(-) diff --git a/next.config.js b/next.config.js index b11c9c466..46f898e2f 100644 --- a/next.config.js +++ b/next.config.js @@ -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, }, ]