Skip to content

[📖] need to document how to do a redirect after post #8531

@wmertens

Description

@wmertens

Suggestion

When doing a routeAction form POST without Javascript, the browser sends the form data to Qwik router and it's converted into an object that the action function receives.

Then, three page is rendered by SSR, and the route action result can be used, but when the user reloads the page, the form action will be repeated.

Instead, the action can do a 303 redirect to a page that shows the action result, possibly based on a session, or using a search param etc.

When the action is called programmatically, it should NOT do the redirect and instead just return the result.

This cannot be generalized, so it must be implemented by the dev.

We need to document how to know it was a browser action and what to redirect towards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR welcomedWe think it's a good feature to have but would love for the community to help with the PR for itdocsImprovements or additions to documentationenhancementNew feature or requestrouter

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions