Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions starters/basic-starter/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@ async function getNode(slug: string[]) {

const type = translatedPath.jsonapi?.resourceName!
const uuid = translatedPath.entity.uuid
const tag = `${translatedPath.entity.type}:${translatedPath.entity.id}`

if (type === "node--article") {
params.include = "field_image,uid"
}

const resource = await drupal.getResource<DrupalNode>(type, uuid, {
params,
next: {
revalidate: 3600,
// Replace `revalidate` with `tags` if using tag based revalidation.
// tags: [tag],
},
})

if (!resource) {
Expand Down
3 changes: 3 additions & 0 deletions starters/basic-starter/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export default async function Home() {
include: "field_image,uid",
sort: "-created",
},
next: {
revalidate: 3600,
},
}
)

Expand Down
Loading