Unverified Commit 242bf65f authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Revert "Fix: Contentful webhook body parse." (#40925)

Reverts vercel/next.js#40732

x-ref:
https://github.com/vercel/next.js/pull/40732#issuecomment-1258779835
parent 3544c795
......@@ -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}`)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment