From 6f5080218dc0460ad5ab4ff157ac509b079ce20d Mon Sep 17 00:00:00 2001 From: Mathias Oterhals Myklebust Date: Tue, 8 Oct 2024 13:50:59 +0200 Subject: [PATCH] refactor: remove `/legal` route dropped the legal subpath in 6fe66758e34575a73831a56f0f697e5e3d624d3c --- src/app/(main)/legal/[id]/page.tsx | 41 ------------------------------ 1 file changed, 41 deletions(-) delete mode 100644 src/app/(main)/legal/[id]/page.tsx diff --git a/src/app/(main)/legal/[id]/page.tsx b/src/app/(main)/legal/[id]/page.tsx deleted file mode 100644 index 0925758d3..000000000 --- a/src/app/(main)/legal/[id]/page.tsx +++ /dev/null @@ -1,41 +0,0 @@ -import Legal from "src/blog/components/legal/Legal"; -import LegalPreview from "src/blog/components/legal/LegalPreview"; -import { getDraftModeInfo } from "src/utils/draftmode"; -import { LegalDocument } from "studio/lib/interfaces/legalDocuments"; -import { LEGAL_DOCUMENTS_BY_SLUG_AND_LANG_QUERY } from "studio/lib/queries/admin"; -import { loadStudioQuery } from "studio/lib/store"; - -export const dynamic = "force-dynamic"; - -type Props = { - params: { - id: string; - }; -}; - -// TODO: hide from SEO??? - -async function Page({ params }: Props) { - const { id } = params; - const { perspective, isDraftMode } = getDraftModeInfo(); - - const initialDocument = await loadStudioQuery( - LEGAL_DOCUMENTS_BY_SLUG_AND_LANG_QUERY, - { slug: id, language: "en" }, //TODO: replace this with selected language for the page - { perspective }, - ); - - if (!initialDocument) { - throw new Error("Page not found"); - } - - if (isDraftMode) { - return ; - } - - if (initialDocument) { - return ; - } -} - -export default Page;