Skip to content

Commit

Permalink
fix: re-order preview data set
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgoff committed Sep 27, 2024
1 parent 0c8a24b commit 4a515e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/api/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const preview = async (request, response) => {
const redirect = `/${locale}`;
const cookiePath = isDefaultSite ? "/" : redirect;

response.redirect(redirect);
response.setPreviewData(
{ previewToken },
{ path: cookiePath, maxAge: 120 }
);
response.redirect(redirect);
} else {
const redirectUri = `/${res.entry.uri}`;
const redirect = `/${locale}${redirectUri}`;
Expand Down

0 comments on commit 4a515e0

Please sign in to comment.