From a19bebb4e85be2130e578bc6be5e9db11f971e91 Mon Sep 17 00:00:00 2001 From: Simon Emanuelsson Date: Mon, 14 Oct 2024 14:44:14 +0200 Subject: [PATCH] feat: add commented out prep for path redirects when missing params --- next.config.js | 93 +++++++++++++++++++++++++++++--------------------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/next.config.js b/next.config.js index 75387bfd4..b11c9c466 100644 --- a/next.config.js +++ b/next.config.js @@ -72,6 +72,28 @@ 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", @@ -82,22 +104,43 @@ const nextConfig = { 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 [ // { // ---------------------------------------- - // Add all required params that should be - // added from Select Room + // Uncomment when Team Explorer has deployed + // the select room submission // ---------------------------------------- - // source: "/:lang/hotelreservation/:path", - // destination: "/:lang", - // missing: [ - // { - // key: "hotelId", - // type: "query", - // value: undefined, - // }, - // ], + // source: "/:lang/hotelreservation/(select-bed|breakfast|details|payment)", + // destination: "/:lang/hotelreservation/select-rate", + // missing: rateQueries, // permanent: false, // }, { @@ -133,33 +176,7 @@ const nextConfig = { { 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, - }, - ], + missing: detailQueries, permanent: false, }, ]