Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
Merging copilot changes into existing file.
  • Loading branch information
backlineint authored Nov 7, 2024
1 parent 84d1e07 commit 44fca0a
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions starters/basic-starter/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -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<DrupalNode>(pathData.entity.type, pathData.entity.id, {
params: {
include: "field_image,uid",
},
next: {
revalidate: 3600,
// tags: [tag],
},
})

if (!node) {
notFound()
}

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

Expand Down

0 comments on commit 44fca0a

Please sign in to comment.