Skip to content

Commit

Permalink
Revert "Fix: Contentful webhook body parse." (#40925)
Browse files Browse the repository at this point in the history
Reverts #40732

x-ref:
#40732 (comment)
  • Loading branch information
ijjk committed Sep 27, 2022
1 parent 3544c79 commit 242bf65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/cms-contentful/pages/api/revalidate.js
Expand Up @@ -14,7 +14,9 @@ export default async function handler(req, res) {
}

try {
let postSlug = JSON.parse(req.body).fields.slug['en-US']
// Note: if this fails to parse you may have forget to set the
// "content-type" header correctly as mentioned here https://github.com/vercel/next.js/blob/canary/examples/cms-contentful/README.md#step-9-try-using-on-demand-revalidation
let postSlug = req.body.fields.slug['en-US']

// revalidate the individual post and the home page
await res.revalidate(`/posts/${postSlug}`)
Expand Down

0 comments on commit 242bf65

Please sign in to comment.