Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redirect after submit #133

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/@episerver/forms-react/src/components/FormBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,9 @@ export const FormBody = (props: FormBodyProps) => {
if (submitButton) {
let redirectToPage = submitButton?.properties?.redirectToPage ?? form.properties?.redirectToPage;
if (!isNullOrEmpty(redirectToPage)) {
let url = new URL(redirectToPage, "http://temp");
props.history && props.history.push(url.pathname);
var cmsUrl = process.env.REACT_APP_HEADLESS_FORM_BASE_URL ?? "http://temp";
let url = new URL(redirectToPage, cmsUrl);
window.location.href = url.href;
}
}
}).catch((e: ProblemDetail) => {
Expand Down
Loading