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

Allow @HxRequest to be ignored for boosted requests #139

Closed
wimdeblauwe opened this issue Nov 2, 2024 · 0 comments · Fixed by #143
Closed

Allow @HxRequest to be ignored for boosted requests #139

wimdeblauwe opened this issue Nov 2, 2024 · 0 comments · Fixed by #143
Milestone

Comments

@wimdeblauwe
Copy link
Owner

We currently have 2 endpoints, one for the hx requests and one for a full page load.

@GetMapping("/{id}")
public String detail(@PathVariable Long id, Model model) {
}

@HxRequest
@GetMapping("/{id}")
public HtmxResponse hxDetail(@PathVariable Long id, Model model) {
}

Now, if we use hx-boost=true, the endpoint for the hx-requests is used per default.

However the purpose of hx-boost is IMHO to trigger a full page load request and let htmx handle it differently on the frontend.

We are aware of htmxRequest.isBoosted() but we think it would be much more useful to allow to ignore boosted optionally, so the full page load can be used.

@HxRequest(ignore_boosted=true) 

We would suggest to set the default to false for backwards compatibility.

Originally posted by @resmo in #138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant