From 44fca0a80315de8e3e66ee81a11fd375e66a48cf Mon Sep 17 00:00:00 2001 From: Brian Perry Date: Thu, 7 Nov 2024 10:33:40 -0600 Subject: [PATCH] Update page.tsx Merging copilot changes into existing file. --- starters/basic-starter/app/[...slug]/page.tsx | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/starters/basic-starter/app/[...slug]/page.tsx b/starters/basic-starter/app/[...slug]/page.tsx index 51d0b99f..512650e5 100644 --- a/starters/basic-starter/app/[...slug]/page.tsx +++ b/starters/basic-starter/app/[...slug]/page.tsx @@ -1,43 +1,3 @@ -import { drupal } from "@/lib/drupal" -import { notFound } from "next/navigation" -import { DrupalNode } from "next-drupal" - -interface PageProps { - params: { - slug: string[] - } -} - -export default async function Page({ params }: PageProps) { - const path = `/${params.slug.join("/")}` - const pathData = await drupal.translatePath(path) - - if (!pathData || !pathData.entity) { - notFound() - } - - const tag = `${pathData.entity.type}:${pathData.entity.id}` - - const node = await drupal.getResource(pathData.entity.type, pathData.entity.id, { - params: { - include: "field_image,uid", - }, - next: { - revalidate: 3600, - // tags: [tag], - }, - }) - - if (!node) { - notFound() - } - - return ( -
-

{node.title}

-
- ) -} import { draftMode } from "next/headers" import { notFound } from "next/navigation" import { getDraftData } from "next-drupal/draft" @@ -76,7 +36,7 @@ async function getNode(slug: string[]) { params, next: { revalidate: 3600, - // tags: [`${type}:${uuid}`], + // tags: [`${type}:${translatedPath.entity.id}`], }, })