Files
Max ProskeandGitHub 9fce9964b6 Remove unstable_revalidate (#43119)
Reverts https://github.com/vercel/next.js/pull/38070

I stumbled upon @ijjk's TODO to remove the deprecated
`unstable_revalidate` renaming error and e2e test after v12.2.

```tsx
// TODO: remove in next minor (current v12.2)
```

I also removed the deprecated function stub, since it probably shouldn't
exist if there's no error, e2e test, and doesn't match the new
`revalidate` function signature anyways.

<img width="675" alt="image"
src="https://user-images.githubusercontent.com/14317828/202842660-be9977e2-252c-4ccf-84fc-e0c00bf25e05.png">
2022-11-19 15:54:19 -08:00

17 lines
402 B
JavaScript

export default async function handler(req, res) {
// WARNING: don't use user input in production
// make sure to use trusted value for revalidating
let revalidated = false
try {
await res.revalidate(req.query.pathname, {
unstable_onlyGenerated: !!req.query.onlyGenerated,
})
revalidated = true
} catch (err) {
console.error(err)
}
res.json({
revalidated,
})
}