refactor(SW-1273): move find my booking routes in order to import them directly into next config
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { findMyBooking } from "@/constants/myBooking"
|
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||||
import { logout } from "@/constants/routes/handleAuth"
|
import { logout } from "@/constants/routes/handleAuth"
|
||||||
import { myPages } from "@/constants/routes/myPages"
|
import { myPages } from "@/constants/routes/myPages"
|
||||||
import useDropdownStore from "@/stores/main-menu"
|
import useDropdownStore from "@/stores/main-menu"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Dialog, Modal } from "react-aria-components"
|
|||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
import { useMediaQuery } from "usehooks-ts"
|
import { useMediaQuery } from "usehooks-ts"
|
||||||
|
|
||||||
import { findMyBooking } from "@/constants/myBooking"
|
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||||
import useDropdownStore from "@/stores/main-menu"
|
import useDropdownStore from "@/stores/main-menu"
|
||||||
|
|
||||||
import LanguageSwitcher from "@/components/LanguageSwitcher"
|
import LanguageSwitcher from "@/components/LanguageSwitcher"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { findMyBooking } from "@/constants/myBooking"
|
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||||
import { getHeader } from "@/lib/trpc/memoizedRequests"
|
import { getHeader } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import { auth } from "@/auth"
|
import { auth } from "@/auth"
|
||||||
|
|||||||
@@ -24,12 +24,3 @@ export const myBooking = {
|
|||||||
sv: "https://test.scandichotels.se/hotelreservation/din-bokning",
|
sv: "https://test.scandichotels.se/hotelreservation/din-bokning",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const findMyBooking = {
|
|
||||||
da: "/da/hotelreservation/hent-booking",
|
|
||||||
de: "/de/hotelreservation/mein-bereich",
|
|
||||||
en: "/en/hotelreservation/get-booking",
|
|
||||||
fi: "/fi/hotelreservation/hae-varaus",
|
|
||||||
no: "/no/hotelreservation/get-booking",
|
|
||||||
sv: "/sv/hotelreservation/hitta-bokning",
|
|
||||||
}
|
|
||||||
|
|||||||
14
apps/scandic-web/constants/routes/findMyBooking.js
Normal file
14
apps/scandic-web/constants/routes/findMyBooking.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/**
|
||||||
|
* @file Due to these records being used in next.config.js, and that is required
|
||||||
|
* to be a js file, we use jsdoc to type these.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @type {import('@/types/routes').LangRoute} */
|
||||||
|
export const findMyBooking = {
|
||||||
|
da: "/da/hotelreservation/hent-booking",
|
||||||
|
de: "/de/hotelreservation/mein-bereich",
|
||||||
|
en: "/en/hotelreservation/get-booking",
|
||||||
|
fi: "/fi/hotelreservation/hae-varaus",
|
||||||
|
no: "/no/hotelreservation/get-booking",
|
||||||
|
sv: "/sv/hotelreservation/hitta-bokning",
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ import * as Sentry from "@sentry/nextjs"
|
|||||||
import createJiti from "jiti"
|
import createJiti from "jiti"
|
||||||
import { fileURLToPath } from "url"
|
import { fileURLToPath } from "url"
|
||||||
|
|
||||||
|
import { findMyBooking } from "./constants/routes/findMyBooking.js"
|
||||||
import { login, logout } from "./constants/routes/handleAuth.js"
|
import { login, logout } from "./constants/routes/handleAuth.js"
|
||||||
import { myPages } from "./constants/routes/myPages.js"
|
import { myPages } from "./constants/routes/myPages.js"
|
||||||
|
|
||||||
@@ -275,27 +276,27 @@ const nextConfig = {
|
|||||||
},
|
},
|
||||||
// Find my booking
|
// Find my booking
|
||||||
{
|
{
|
||||||
source: "/en/hotelreservation/get-booking",
|
source: findMyBooking.en,
|
||||||
destination: "/en/hotelreservation/get-booking",
|
destination: "/en/hotelreservation/get-booking",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: "/no/hotelreservation/get-booking",
|
source: findMyBooking.da,
|
||||||
destination: "/no/hotelreservation/get-booking",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "/da/hotelreservation/hent-booking",
|
|
||||||
destination: "/da/hotelreservation/get-booking",
|
destination: "/da/hotelreservation/get-booking",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: "/de/hotelreservation/mein-bereich",
|
source: findMyBooking.de,
|
||||||
destination: "/de/hotelreservation/get-booking",
|
destination: "/de/hotelreservation/get-booking",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: "/fi/hotelreservation/hae-varaus",
|
source: findMyBooking.fi,
|
||||||
destination: "/fi/hotelreservation/get-booking",
|
destination: "/fi/hotelreservation/get-booking",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
source: "/sv/hotelreservation/hitta-bokning",
|
source: findMyBooking.no,
|
||||||
|
destination: "/no/hotelreservation/get-booking",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
source: findMyBooking.sv,
|
||||||
destination: "/sv/hotelreservation/get-booking",
|
destination: "/sv/hotelreservation/get-booking",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { metrics } from "@opentelemetry/api"
|
import { metrics } from "@opentelemetry/api"
|
||||||
|
|
||||||
import { Lang } from "@/constants/languages"
|
import { Lang } from "@/constants/languages"
|
||||||
import { findMyBooking } from "@/constants/myBooking"
|
|
||||||
import { baseUrls } from "@/constants/routes/baseUrls"
|
import { baseUrls } from "@/constants/routes/baseUrls"
|
||||||
|
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||||
import { batchRequest } from "@/lib/graphql/batchRequest"
|
import { batchRequest } from "@/lib/graphql/batchRequest"
|
||||||
import {
|
import {
|
||||||
GetDaDeEnUrlsAccountPage,
|
GetDaDeEnUrlsAccountPage,
|
||||||
|
|||||||
Reference in New Issue
Block a user