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 { useIntl } from "react-intl"
|
||||
|
||||
import { findMyBooking } from "@/constants/myBooking"
|
||||
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||
import { logout } from "@/constants/routes/handleAuth"
|
||||
import { myPages } from "@/constants/routes/myPages"
|
||||
import useDropdownStore from "@/stores/main-menu"
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Dialog, Modal } from "react-aria-components"
|
||||
import { useIntl } from "react-intl"
|
||||
import { useMediaQuery } from "usehooks-ts"
|
||||
|
||||
import { findMyBooking } from "@/constants/myBooking"
|
||||
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||
import useDropdownStore from "@/stores/main-menu"
|
||||
|
||||
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 { auth } from "@/auth"
|
||||
|
||||
@@ -24,12 +24,3 @@ export const myBooking = {
|
||||
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 { fileURLToPath } from "url"
|
||||
|
||||
import { findMyBooking } from "./constants/routes/findMyBooking.js"
|
||||
import { login, logout } from "./constants/routes/handleAuth.js"
|
||||
import { myPages } from "./constants/routes/myPages.js"
|
||||
|
||||
@@ -275,27 +276,27 @@ const nextConfig = {
|
||||
},
|
||||
// Find my booking
|
||||
{
|
||||
source: "/en/hotelreservation/get-booking",
|
||||
source: findMyBooking.en,
|
||||
destination: "/en/hotelreservation/get-booking",
|
||||
},
|
||||
{
|
||||
source: "/no/hotelreservation/get-booking",
|
||||
destination: "/no/hotelreservation/get-booking",
|
||||
},
|
||||
{
|
||||
source: "/da/hotelreservation/hent-booking",
|
||||
source: findMyBooking.da,
|
||||
destination: "/da/hotelreservation/get-booking",
|
||||
},
|
||||
{
|
||||
source: "/de/hotelreservation/mein-bereich",
|
||||
source: findMyBooking.de,
|
||||
destination: "/de/hotelreservation/get-booking",
|
||||
},
|
||||
{
|
||||
source: "/fi/hotelreservation/hae-varaus",
|
||||
source: findMyBooking.fi,
|
||||
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",
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { metrics } from "@opentelemetry/api"
|
||||
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { findMyBooking } from "@/constants/myBooking"
|
||||
import { baseUrls } from "@/constants/routes/baseUrls"
|
||||
import { findMyBooking } from "@/constants/routes/findMyBooking"
|
||||
import { batchRequest } from "@/lib/graphql/batchRequest"
|
||||
import {
|
||||
GetDaDeEnUrlsAccountPage,
|
||||
|
||||
Reference in New Issue
Block a user