Skip to content

Commit

Permalink
Merge branch 'main' into add-cache-option
Browse files Browse the repository at this point in the history
  • Loading branch information
backlineint authored Nov 8, 2024
2 parents 98ee918 + bac0ee8 commit a3d1650
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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

0 comments on commit a3d1650

Please sign in to comment.