Merged in fix/redirect-service-revert (pull request #1818)
hotfix: uncomment new stuff that broke destination page * hotfix: uncomment new stuff that broke destination page Approved-by: Michael Zetterberg Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
import { notFound } from "next/navigation"
|
|
||||||
|
|
||||||
import styles from "./layout.module.css"
|
import styles from "./layout.module.css"
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
@@ -8,13 +6,12 @@ import type {
|
|||||||
LayoutArgs,
|
LayoutArgs,
|
||||||
UIDParams,
|
UIDParams,
|
||||||
} from "@/types/params"
|
} from "@/types/params"
|
||||||
import { PageContentTypeEnum } from "@/types/requests/contentType"
|
|
||||||
|
|
||||||
export default function ContentTypeLayout({
|
export default function ContentTypeLayout({
|
||||||
breadcrumbs,
|
breadcrumbs,
|
||||||
preview,
|
preview,
|
||||||
children,
|
children,
|
||||||
params,
|
//params,
|
||||||
}: React.PropsWithChildren<
|
}: React.PropsWithChildren<
|
||||||
LayoutArgs<LangParams & ContentTypeParams & UIDParams> & {
|
LayoutArgs<LangParams & ContentTypeParams & UIDParams> & {
|
||||||
breadcrumbs: React.ReactNode
|
breadcrumbs: React.ReactNode
|
||||||
@@ -23,9 +20,9 @@ export default function ContentTypeLayout({
|
|||||||
>) {
|
>) {
|
||||||
// Would like a better way to check if the contentType is valid.
|
// Would like a better way to check if the contentType is valid.
|
||||||
// Perhaps a case for using an `{} as const` object for PageContentTypes instead?
|
// Perhaps a case for using an `{} as const` object for PageContentTypes instead?
|
||||||
if (!Object.values(PageContentTypeEnum).includes(params.contentType)) {
|
// if (!Object.values(PageContentTypeEnum).includes(params.contentType)) {
|
||||||
notFound()
|
// notFound()
|
||||||
}
|
// }
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<section className={styles.layout}>
|
<section className={styles.layout}>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import * as currentWebLogout from "@/middlewares/currentWebLogout"
|
|||||||
import * as dateFormat from "@/middlewares/dateFormat"
|
import * as dateFormat from "@/middlewares/dateFormat"
|
||||||
import * as handleAuth from "@/middlewares/handleAuth"
|
import * as handleAuth from "@/middlewares/handleAuth"
|
||||||
import * as myPages from "@/middlewares/myPages"
|
import * as myPages from "@/middlewares/myPages"
|
||||||
import * as redirect from "@/middlewares/redirect"
|
|
||||||
import * as sasXScandic from "@/middlewares/sasXScandic"
|
import * as sasXScandic from "@/middlewares/sasXScandic"
|
||||||
import { getDefaultRequestHeaders } from "@/middlewares/utils"
|
import { getDefaultRequestHeaders } from "@/middlewares/utils"
|
||||||
import * as webView from "@/middlewares/webView"
|
import * as webView from "@/middlewares/webView"
|
||||||
@@ -59,7 +58,7 @@ export const middleware: NextMiddleware = async (request, event) => {
|
|||||||
bookingFlow,
|
bookingFlow,
|
||||||
sasXScandic,
|
sasXScandic,
|
||||||
cmsContent,
|
cmsContent,
|
||||||
redirect,
|
//redirect,
|
||||||
]
|
]
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user