Files
JJ KasperandGitHub 6f352357fb Ensure path can be specified for clearPreviewData (#40238)
As updated in https://github.com/vercel/next.js/pull/38313 this ensures the `path` option can also be passed to `clearPreviewData` to properly clear the preview cookies. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Fixes: https://github.com/vercel/next.js/issues/39853
2022-09-05 13:37:08 -07:00

11 lines
186 B
JavaScript

export default (req, res) => {
res.clearPreviewData(
req.query.cookiePath
? {
path: req.query.cookiePath,
}
: undefined
)
res.status(200).end()
}